]> granicus.if.org Git - php/commitdiff
Fixed bug#54450 (callback function when built against libedit)
authorHannes Magnusson <bjori@php.net>
Tue, 6 Sep 2011 15:07:24 +0000 (15:07 +0000)
committerHannes Magnusson <bjori@php.net>
Tue, 6 Sep 2011 15:07:24 +0000 (15:07 +0000)
ext/readline/config.m4
ext/readline/readline.c

index 729033b74f18dd0d0240356c1f4705f0f552e371..b1cb0b67e823befe345145d89ce65a1b958b4160 100644 (file)
@@ -60,6 +60,13 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
     -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
   ])
 
+  PHP_CHECK_LIBRARY(edit, rl_on_new_line,
+  [
+    AC_DEFINE(HAVE_RL_ON_NEW_LINE, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
+  ])
+
   AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
 
 elif test "$PHP_LIBEDIT" != "no"; then
@@ -93,6 +100,20 @@ elif test "$PHP_LIBEDIT" != "no"; then
     -L$READLINE_DIR/$PHP_LIBDIR 
   ])
 
+  PHP_CHECK_LIBRARY(edit, rl_callback_read_char,
+  [
+    AC_DEFINE(HAVE_RL_CALLBACK_READ_CHAR, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR
+  ])
+
+  PHP_CHECK_LIBRARY(edit, rl_on_new_line,
+  [
+    AC_DEFINE(HAVE_RL_ON_NEW_LINE, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR
+  ])
+
   AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
 fi
 
index e9cdacb275a4c0a13050147da9bd46d76dbc284d..ee23777f6bcc740a06140b5dc6281c7aa515d081 100644 (file)
@@ -144,6 +144,8 @@ static const zend_function_entry php_readline_functions[] = {
        PHP_FE(readline_callback_read_char,                     arginfo_readline_callback_read_char)
        PHP_FE(readline_callback_handler_remove,        arginfo_readline_callback_handler_remove)
        PHP_FE(readline_redisplay, arginfo_readline_redisplay)
+#endif
+#if HAVE_RL_ON_NEW_LINE
        PHP_FE(readline_on_new_line, arginfo_readline_on_new_line)
 #endif
        PHP_FE_END
@@ -617,6 +619,9 @@ PHP_FUNCTION(readline_redisplay)
 }
 /* }}} */
 
+#endif
+
+#if HAVE_RL_ON_NEW_LINE
 /* {{{ proto void readline_on_new_line(void)
    Inform readline that the cursor has moved to a new line */
 PHP_FUNCTION(readline_on_new_line)