Skip to content

Commit d9f5735

Browse files
committed
Sync #if/ifdef/defined
These are either undefined or defined to 1: - HAVE_LIBEDIT - HAVE_LIBREADLINE - ZEND_MAX_EXECUTION_TIMERS Follow up of phpGH-5526 (-Wundef)
1 parent d8795a3 commit d9f5735

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Zend/zend_execute_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ void zend_unset_timeout(void) /* {{{ */
16271627
}
16281628
tq_timer = NULL;
16291629
}
1630-
#elif ZEND_MAX_EXECUTION_TIMERS
1630+
#elif defined(ZEND_MAX_EXECUTION_TIMERS)
16311631
zend_max_execution_timer_settime(0);
16321632
#elif defined(HAVE_SETITIMER)
16331633
if (EG(timeout_seconds)) {

ext/readline/php_readline.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
#ifndef PHP_READLINE_H
1818
#define PHP_READLINE_H
1919

20-
#if HAVE_LIBEDIT
20+
#ifdef HAVE_LIBEDIT
2121
#define READLINE_LIB "libedit"
2222
#else
2323
#define READLINE_LIB "readline"
2424
#endif
2525

26-
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
26+
#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
2727

2828
extern zend_module_entry readline_module_entry;
2929
#define phpext_readline_ptr &readline_module_entry

ext/readline/readline.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "readline_cli.h"
2626
#include "readline_arginfo.h"
2727

28-
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
28+
#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
2929

3030
#ifndef HAVE_RL_COMPLETION_MATCHES
3131
#define rl_completion_matches completion_matches
@@ -74,7 +74,7 @@ ZEND_GET_MODULE(readline)
7474

7575
PHP_MINIT_FUNCTION(readline)
7676
{
77-
#if HAVE_LIBREADLINE
77+
#ifdef HAVE_LIBREADLINE
7878
/* libedit don't need this call which set the tty in cooked mode */
7979
using_history();
8080
#endif
@@ -291,7 +291,7 @@ PHP_FUNCTION(readline_clear_history)
291291
RETURN_THROWS();
292292
}
293293

294-
#if HAVE_LIBEDIT
294+
#ifdef HAVE_LIBEDIT
295295
/* clear_history is the only function where rl_initialize
296296
is not call to ensure correct allocation */
297297
using_history();
@@ -572,7 +572,7 @@ PHP_FUNCTION(readline_redisplay)
572572
RETURN_THROWS();
573573
}
574574

575-
#if HAVE_LIBEDIT
575+
#ifdef HAVE_LIBEDIT
576576
/* seems libedit doesn't take care of rl_initialize in rl_redisplay
577577
* see bug #72538 */
578578
using_history();

ext/readline/readline_cli.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <unixlib/local.h>
3939
#endif
4040

41-
#if HAVE_LIBEDIT
41+
#ifdef HAVE_LIBEDIT
4242
#include <editline/readline.h>
4343
#else
4444
#include <readline/readline.h>
@@ -687,7 +687,7 @@ static int readline_shell_run(void) /* {{{ */
687687
}
688688

689689
if (history_lines_to_write) {
690-
#if HAVE_LIBEDIT
690+
#ifdef HAVE_LIBEDIT
691691
write_history(history_file);
692692
#else
693693
append_history(history_lines_to_write, history_file);

sapi/cli/php_cli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
862862
goto err;
863863
}
864864

865-
#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) && (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
865+
#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) && (defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)) && !defined(COMPILE_DL_READLINE)
866866
if (!interactive) {
867867
/* The -a option was not passed. If there is no file, it could
868868
still make sense to run interactively. The presence of a file

0 commit comments

Comments
 (0)