Readline versions up to and including 6.2 miss to declare the public
symbol rl_free_keymap(). We currently work around this issue by
manually declaring the function in interactive.c.
The recently released readline-6.3, however, does declare that symbol.
Since we compile with -Wredundant-decls this leads to the following
warning:
interactive.c:239:6: warning: redundant redeclaration of 'rl_free_keymap' [-Wredundant-decls]
void rl_free_keymap(Keymap keymap);
This patch gets rid of the warning by adding a check to configure.ac
which detects whether the symbol is declared in the readline header
file. Only if it is uncdelared we declare it manually as before.
fi
if test "$have_readline" = "yes"; then
- :
+ AC_CHECK_DECL(
+ [rl_free_keymap],
+ [AC_DEFINE(RL_FREE_KEYMAP_DECLARED, 1, readline >= 6.3)],
+ [],
+ [
+ #include <stdio.h>
+ #include <readline/readline.h>
+ ]
+ )
AC_SUBST(readline_cppflags)
AC_SUBST(readline_ldflags)
AC_DEFINE(HAVE_READLINE, 1, define to 1 to turn on readline support)
fprintf(i9ep->stderr_stream, "\r");
}
+#ifndef RL_FREE_KEYMAP_DECLARED
/**
* Free all storage associated with a keymap.
*
* \param keymap The keymap to deallocate.
*/
void rl_free_keymap(Keymap keymap);
+#endif
/**
* Reset the terminal and save the in-memory command line history.