Skip to content

Sync #if/ifdef/defined (readline and Zend max execution timers) #14512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/zend_execute_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions ext/readline/php_readline.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ext/readline/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions ext/readline/readline_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <unixlib/local.h>
#endif

#if HAVE_LIBEDIT
#ifdef HAVE_LIBEDIT
#include <editline/readline.h>
#else
#include <readline/readline.h>
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion sapi/cli/php_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading