Skip to content

Commit 9017c58

Browse files
committed
Merge branch 'feature-upgrade-apcu' into experiment-feature
2 parents bde7af0 + 4209c5a commit 9017c58

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ext/readline/readline_cli.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,24 @@ typedef cli_shell_callbacks_t *(__cdecl *get_cli_shell_callbacks)(void);
739739
} while(0)
740740

741741
#else
742+
/*
743+
#ifdef COMPILE_DL_READLINE
744+
This dlsym() is always used as even the CGI SAPI is linked against "CLI"-only
745+
extensions. If that is being changed dlsym() should only be used when building
746+
this extension sharedto offer compatibility.
747+
*/
748+
#define GET_SHELL_CB(cb) \
749+
do { \
750+
(cb) = NULL; \
751+
cli_shell_callbacks_t *(*get_callbacks)(void); \
752+
get_callbacks = dlsym(RTLD_DEFAULT, "php_cli_get_shell_callbacks"); \
753+
if (get_callbacks) { \
754+
(cb) = get_callbacks(); \
755+
} \
756+
} while(0)
757+
/*#else
742758
#define GET_SHELL_CB(cb) (cb) = php_cli_get_shell_callbacks()
743-
759+
#endif*/
744760
#endif
745761

746762
PHP_MINIT_FUNCTION(cli_readline)

0 commit comments

Comments
 (0)