diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 3cea0d5b0accf..9aafeb70f13b5 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1627,7 +1627,7 @@ void zend_unset_timeout(void) /* {{{ */ } tq_timer = NULL; } -#elif ZEND_MAX_EXECUTION_TIMERS +#elif defined(ZEND_MAX_EXECUTION_TIMERS) zend_max_execution_timer_settime(0); #elif defined(HAVE_SETITIMER) if (EG(timeout_seconds)) { diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h index a9b56b6167df4..f67238db663ae 100644 --- a/ext/readline/php_readline.h +++ b/ext/readline/php_readline.h @@ -17,13 +17,13 @@ #ifndef PHP_READLINE_H #define PHP_READLINE_H -#if HAVE_LIBEDIT +#ifdef HAVE_LIBEDIT #define READLINE_LIB "libedit" #else #define READLINE_LIB "readline" #endif -#if HAVE_LIBREADLINE || HAVE_LIBEDIT +#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT) extern zend_module_entry readline_module_entry; #define phpext_readline_ptr &readline_module_entry diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 1bd5e2fd6059a..b4d45aab88581 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -25,7 +25,7 @@ #include "readline_cli.h" #include "readline_arginfo.h" -#if HAVE_LIBREADLINE || HAVE_LIBEDIT +#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT) #ifndef HAVE_RL_COMPLETION_MATCHES #define rl_completion_matches completion_matches @@ -74,7 +74,7 @@ ZEND_GET_MODULE(readline) PHP_MINIT_FUNCTION(readline) { -#if HAVE_LIBREADLINE +#ifdef HAVE_LIBREADLINE /* libedit don't need this call which set the tty in cooked mode */ using_history(); #endif @@ -291,7 +291,7 @@ PHP_FUNCTION(readline_clear_history) RETURN_THROWS(); } -#if HAVE_LIBEDIT +#ifdef HAVE_LIBEDIT /* clear_history is the only function where rl_initialize is not call to ensure correct allocation */ using_history(); @@ -572,7 +572,7 @@ PHP_FUNCTION(readline_redisplay) RETURN_THROWS(); } -#if HAVE_LIBEDIT +#ifdef HAVE_LIBEDIT /* seems libedit doesn't take care of rl_initialize in rl_redisplay * see bug #72538 */ using_history(); diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index 7bbd84aa6562c..80ddd88f7d42b 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -38,7 +38,7 @@ #include #endif -#if HAVE_LIBEDIT +#ifdef HAVE_LIBEDIT #include #else #include @@ -687,7 +687,7 @@ static int readline_shell_run(void) /* {{{ */ } if (history_lines_to_write) { -#if HAVE_LIBEDIT +#ifdef HAVE_LIBEDIT write_history(history_file); #else append_history(history_lines_to_write, history_file); diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 683a01b091a13..2049527b0ae03 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -862,7 +862,7 @@ static int do_cli(int argc, char **argv) /* {{{ */ goto err; } -#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) && (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) +#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) && (defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)) && !defined(COMPILE_DL_READLINE) if (!interactive) { /* The -a option was not passed. If there is no file, it could still make sense to run interactively. The presence of a file