smbreadline: switch to new-style readline typedef
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Thu, 6 Mar 2014 21:57:40 +0000 (18:57 -0300)
committerJeremy Allison <jra@samba.org>
Wed, 12 Mar 2014 23:21:44 +0000 (00:21 +0100)
Function, CPFunction, CPPFunction and VFunction typedefs are considered
old-style (deprecated) starting from readline 4.2 (circa 2001).
Compatibility typedefs have been in place up to readline 6.2 but were
removed with the 6.3 release thus causing builds to break.
Switch to the new-style specific prototyped typedef.

Return value is unused so the callback should still be void (see
readline/input.c around line 456 in version 6.3).

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 13 00:21:47 CET 2014 on sn-devel-104

libcli/smbreadline/smbreadline.c

index cff25a7f5a554c6af6620706d7a46dfdb5143a4e..80e10b0071cc8e8791c9d6e6a4a7042c21a44bde 100644 (file)
@@ -141,7 +141,7 @@ char *smb_readline(const char *prompt, void (*callback)(void),
 
 #if HAVE_DECL_RL_EVENT_HOOK
        if (callback)
 
 #if HAVE_DECL_RL_EVENT_HOOK
        if (callback)
-               rl_event_hook = (Function *)callback;
+               rl_event_hook = (rl_hook_func_t *)callback;
 #endif
        ret = readline(prompt);
        if (ret && *ret)
 #endif
        ret = readline(prompt);
        if (ret && *ret)