]> granicus.if.org Git - php/commitdiff
- Fix compile failure when ext/readline is compiled as shared
authorfoobar <sniper@php.net>
Thu, 17 Nov 2005 08:36:12 +0000 (08:36 +0000)
committerfoobar <sniper@php.net>
Thu, 17 Nov 2005 08:36:12 +0000 (08:36 +0000)
sapi/cli/php_cli.c
sapi/cli/php_cli_readline.c

index 29f287bacce5e0c7ce50b5d8be19422bc8f981bc..f69fe9dc5fb249cbe460b3015e76f2d4fff5b119 100644 (file)
 #include <unixlib/local.h>
 #endif
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
 #include <readline/readline.h>
 #if !HAVE_LIBEDIT
 #include <readline/history.h>
 #endif
+#include "php_cli_readline.h"
 #endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
 
 #include "zend_compile.h"
@@ -84,9 +85,7 @@
 #include "zend_highlight.h"
 #include "zend_indent.h"
 
-
 #include "php_getopt.h"
-#include "php_cli_readline.h"
 
 #ifndef O_BINARY
 #define O_BINARY 0
 
 static char *php_optarg = NULL;
 static int php_optind = 1;
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
 static char php_last_char = '\0';
 #endif
 
@@ -218,7 +217,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC)
        uint remaining = str_length;
        size_t ret;
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
        if (!str_length) {
                return 0;
        }
@@ -396,7 +395,7 @@ static void php_cli_usage(char *argv0)
                    "       %s [options] -- [args...]\n"
                    "       %s [options] -a\n"
                    "\n"
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
                                "  -a               Run as interactive shell\n"
 #else
                                "  -a               Run interactively\n"
@@ -1002,7 +1001,7 @@ int main(int argc, char *argv[])
                                cli_register_file_handles(TSRMLS_C);
                        }
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
                        if (interactive) {
                                char *line;
                                size_t size = 4096, pos = 0, len;
index 1abc5bc93ffdb03b7ce497ab41f1f63bc11ba7fc..ed6362d99d1a5876850371973ffef941f9bd78e5 100644 (file)
@@ -20,6 +20,9 @@
 /* $Id$ */
 
 #include "php.h"
+
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
+
 #include "php_globals.h"
 #include "php_variables.h"
 #include "zend_hash.h"
 #include <unixlib/local.h>
 #endif
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
 #include <readline/readline.h>
 #if !HAVE_LIBEDIT
 #include <readline/history.h>
 #endif
-#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
 
 #include "zend_compile.h"
 #include "zend_execute.h"
 #include "zend_highlight.h"
 #include "zend_indent.h"
 
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
-
 /* {{{ cli_is_valid_code
  */
 typedef enum {