summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-07 07:56:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:49 -0500
commitead21647a248b250876ce7d2133bd4a1fe2b2d57 (patch)
tree512dedae573f4fc52ceb58080f03b4bbb643db4b /source4/lib
parent8717b5e3e65cc604293a03a55ba6f74f90355005 (diff)
downloadsamba-ead21647a248b250876ce7d2133bd4a1fe2b2d57.tar.gz
samba-ead21647a248b250876ce7d2133bd4a1fe2b2d57.tar.bz2
samba-ead21647a248b250876ce7d2133bd4a1fe2b2d57.zip
r18207: not all readline libs have rl_event_hook
this should help with coreserverbuild (Mac OS X) (This used to be commit b0efbdfa98cfda87a78874c2a71a52cc091e4021)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/smbreadline/readline.m43
-rw-r--r--source4/lib/smbreadline/smbreadline.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/smbreadline/readline.m4 b/source4/lib/smbreadline/readline.m4
index e19f0a1744..4eebd13b5a 100644
--- a/source4/lib/smbreadline/readline.m4
+++ b/source4/lib/smbreadline/readline.m4
@@ -68,6 +68,9 @@ AC_CHECK_LIB(readline, rl_completion_matches,
[],
[$TERMLIBS])
+# not all readline libs have rl_event_hook
+AC_CHECK_DECLS(rl_event_hook, [], [], [#include <readline/readline.h>])
+
AC_MSG_CHECKING(whether to use extern readline)
if test x"$EXTERNAL_READLINE" = x"yes"; then
AC_MSG_RESULT(yes)
diff --git a/source4/lib/smbreadline/smbreadline.c b/source4/lib/smbreadline/smbreadline.c
index 3d046f6099..6b8e54e1e3 100644
--- a/source4/lib/smbreadline/smbreadline.c
+++ b/source4/lib/smbreadline/smbreadline.c
@@ -127,8 +127,10 @@ char *smb_readline(const char *prompt, void (*callback)(void),
rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn;
}
+#if HAVE_DECL_RL_EVENT_HOOK
if (callback)
rl_event_hook = (Function *)callback;
+#endif
ret = readline(prompt);
if (ret && *ret)
add_history(ret);