mirror of
https://github.com/troglobit/editline.git
synced 2025-05-05 20:11:12 +08:00
config.h.in, configure, configure.ac:
Add configure support for ANSI arrow keys. Tested OK with gnome-terminal. src/complete.c: Remove usage of CONST and refactor compare() to use standard C syntax instead of old K&R.
This commit is contained in:
parent
4898413730
commit
69e01d11d4
@ -1,5 +1,8 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to include ANSI arrow keys support in minix-editline */
|
||||
#undef ANSI_ARROWS
|
||||
|
||||
/* Define to 1 if the `closedir' function returns void instead of `int'. */
|
||||
#undef CLOSEDIR_VOID
|
||||
|
||||
|
19
configure
vendored
19
configure
vendored
@ -1286,6 +1286,7 @@ Optional Features:
|
||||
--disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors
|
||||
--enable-default-complete Enable default completion handler.
|
||||
--enable-arrow-keys Enable ANSI arrow keys.
|
||||
|
||||
Some influential environment variables:
|
||||
CC C compiler command
|
||||
@ -5003,6 +5004,23 @@ else
|
||||
fi
|
||||
|
||||
|
||||
ac_enable_arrow_keys=no
|
||||
# Check whether --enable-arrow-keys was given.
|
||||
if test "${enable_arrow_keys+set}" = set; then
|
||||
enableval=$enable_arrow_keys; ac_enable_arrow_keys=$enableval
|
||||
else
|
||||
ac_enable_arrow_keys=no
|
||||
fi
|
||||
|
||||
|
||||
if test "x${ac_enable_arrow_keys}" = xyes ; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define ANSI_ARROWS
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile man/Makefile examples/Makefile"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
@ -6342,3 +6360,4 @@ if test "$no_create" != yes; then
|
||||
$ac_cs_success || { (exit 1); exit 1; }
|
||||
fi
|
||||
|
||||
|
||||
|
11
configure.ac
11
configure.ac
@ -55,4 +55,15 @@ AC_ARG_ENABLE([default-complete],
|
||||
esac],[complete=false])
|
||||
AM_CONDITIONAL([COMPLETE], [test x$complete = xtrue])
|
||||
|
||||
ac_enable_arrow_keys=no
|
||||
AC_ARG_ENABLE(arrow-keys,
|
||||
[ --enable-arrow-keys Enable ANSI arrow keys.],
|
||||
[ ac_enable_arrow_keys=$enableval ], [ ac_enable_arrow_keys=no])
|
||||
|
||||
if test "x${ac_enable_arrow_keys}" = xyes ; then
|
||||
AC_DEFINE([ANSI_ARROWS], [],
|
||||
[Define to include ANSI arrow keys support in minix-editline])
|
||||
fi
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile include/Makefile man/Makefile examples/Makefile)
|
||||
|
||||
|
@ -25,15 +25,11 @@ strdup(p)
|
||||
** strcmp-like sorting predicate for qsort.
|
||||
*/
|
||||
static int
|
||||
compare(p1, p2)
|
||||
CONST void *p1;
|
||||
CONST void *p2;
|
||||
compare(void *p1, void *p2)
|
||||
{
|
||||
CONST char **v1;
|
||||
CONST char **v2;
|
||||
char **v1 = (char **)p1;
|
||||
char **v2 = (char **)p2;
|
||||
|
||||
v1 = (CONST char **)p1;
|
||||
v2 = (CONST char **)p2;
|
||||
return strcmp(*v1, *v2);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user