1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Sync #if/ifdef/defined (#14512)

These are either undefined or defined to 1:
- HAVE_LIBEDIT
- HAVE_LIBREADLINE
- ZEND_MAX_EXECUTION_TIMERS

Follow up of GH-5526 (-Wundef)
This commit is contained in:
Peter Kokot
2024-06-10 08:56:10 +02:00
committed by GitHub
parent d3901b8ca6
commit c3388c1841
5 changed files with 10 additions and 10 deletions

View File

@@ -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)) {

View File

@@ -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

View File

@@ -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();

View File

@@ -38,7 +38,7 @@
#include <unixlib/local.h>
#endif
#if HAVE_LIBEDIT
#ifdef HAVE_LIBEDIT
#include <editline/readline.h>
#else
#include <readline/readline.h>
@@ -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);

View File

@@ -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