Skip to content

Commit

Permalink
libedit: fix a compatibility issue that appeared in gdb 7.6
Browse files Browse the repository at this point in the history
gdb76 has a patch for it, but this change will increase compatibility
with other readline users as well.
  • Loading branch information
rofl0r committed Dec 27, 2013
1 parent 9bdaf34 commit 10a0217
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
30 changes: 24 additions & 6 deletions KEEP/libedit_readlineh.patch
@@ -1,6 +1,24 @@
78,80c78
< #if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
< #include <sys/ttydefaults.h>
< #endif
---
> /* sys/ttydefaults.h commented out in musl version */
--- libedit-20121213-3.0/src/editline/readline.h
+++ libedit-20121213-3.0.patched/src/editline/readline.h
@@ -75,9 +75,7 @@

#ifndef CTRL
#include <sys/ioctl.h>
-#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
-#include <sys/ttydefaults.h>
-#endif
+/* sys/ttydefaults.h commented out in musl version */
#ifndef CTRL
#define CTRL(c) ((c) & 037)
#endif
@@ -105,6 +103,10 @@
extern int rl_point, rl_end;
extern int history_base, history_length;
extern int max_input_history;
+/* compatibility fix: max_input_history was renamed to
+ history_max_entries in readline 4.2, this is required
+ to build gdb 7.6 against libedit */
+#define history_max_entries max_input_history
extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
2 changes: 1 addition & 1 deletion pkg/libedit
Expand Up @@ -9,7 +9,7 @@ sha512=06420df987429bdec6aea216046548cb7d1e1ed004e140c01692625dfb9149cc42ad98755
termcap

[build]
patch -p0 src/editline/readline.h -i "$K/libedit_readlineh.patch" || exit 1
patch -p1 < "$K"/libedit_readlineh.patch || exit 1

CFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE -D__STDC_ISO_10646__ $optcflags" \
./configure -C --prefix="$butch_prefix" --enable-widec || exit 1
Expand Down

0 comments on commit 10a0217

Please sign in to comment.