mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
Detect libreadline>=4.0, and set HAVE_NEW_LIBREADLINE. At the moment
this is only to get the cast right, but it might help with other parts of the API that changed later. (This used to be commit b792c9317ab62fe407de34ed811cc883a7652cc4)
This commit is contained in:
parent
40b8b058d2
commit
b99209cce4
1025
source3/configure
vendored
1025
source3/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -483,6 +483,15 @@ AC_ARG_WITH(readline,
|
||||
AC_SUBST(TERMLIBS)
|
||||
AC_SUBST(TERMLDFLAGS)
|
||||
|
||||
# The readline API changed slightly from readline3 to readline4, so
|
||||
# code will generate warnings on one of them unless we have a few
|
||||
# special cases.
|
||||
AC_CHECK_LIB(readline, rl_completion_matches,
|
||||
[AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
|
||||
[Do we have rl_completion_matches?])],
|
||||
[],
|
||||
[$TERMLIBS])
|
||||
|
||||
# The following test taken from the cvs sources
|
||||
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
|
||||
# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
@ -1050,6 +1050,9 @@
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Do we have rl_completion_matches? */
|
||||
#undef HAVE_NEW_LIBREADLINE
|
||||
|
||||
/* Define if you have working AF_LOCAL sockets */
|
||||
#undef HAVE_WORKING_AF_LOCAL
|
||||
|
||||
|
@ -22,6 +22,13 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#ifdef HAVE_NEW_LIBREADLINE
|
||||
# define RL_COMPLETION_CAST (rl_completion_func_t *)
|
||||
#else
|
||||
/* This type is missing from libreadline<4.0 (approximately) */
|
||||
# define RL_COMPLETION_FUNC_T
|
||||
#endif /* HAVE_NEW_LIBREADLINE */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
display the prompt and wait for input. Call callback() regularly
|
||||
@ -76,11 +83,9 @@ char *smb_readline(char *prompt, void (*callback)(void),
|
||||
/* The callback prototype has changed slightly between
|
||||
different versions of Readline, so the same function
|
||||
works in all of them to date, but we get compiler
|
||||
warnings in some. NOTE: that not all versions of
|
||||
readline have rl_completion_func_t so attempting to cast
|
||||
the statement below to get rid of the warning will not
|
||||
compile for everyone. */
|
||||
rl_attempted_completion_function = completion_fn;
|
||||
warnings in some. */
|
||||
rl_attempted_completion_function = RL_COMPLETION_CAST
|
||||
completion_fn;
|
||||
}
|
||||
|
||||
if (callback) rl_event_hook = (Function *)callback;
|
||||
|
Loading…
x
Reference in New Issue
Block a user