Skip to content

Commit 3d46385

Browse files
committed
Add macros for child init hooks
1 parent ae60649 commit 3d46385

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎ext/session/session.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,7 +3450,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
34503450
return retval;
34513451
}
34523452

3453-
static void php_session_child_init(void)
3453+
PHP_CINIT_FUNCTION(session)
34543454
{
34553455
/* Give each child a distinct, widely separated GC sequence without requesting new entropy. */
34563456
uint64_t advance = (uint64_t) getpid() << 32;
@@ -3469,7 +3469,7 @@ zend_module_entry session_module_entry = {
34693469
PHP_GINIT(ps),
34703470
NULL,
34713471
NULL,
3472-
STANDARD_MODULE_PROPERTIES_EX_WITH_CHILD_INIT(php_session_child_init)
3472+
STANDARD_MODULE_PROPERTIES_EX_WITH_CHILD_INIT(PHP_CINIT(session))
34733473
};
34743474

34753475
#ifdef COMPILE_DL_SESSION

‎main/php.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ END_EXTERN_C()
377377
#define PHP_MINFO_FUNCTION ZEND_MODULE_INFO_D
378378
#define PHP_GINIT_FUNCTION ZEND_GINIT_FUNCTION
379379
#define PHP_GSHUTDOWN_FUNCTION ZEND_GSHUTDOWN_FUNCTION
380+
#define PHP_CINIT_FUNCTION(module) static void php_##module##_child_init(void)
381+
#define PHP_CINIT(module) php_##module##_child_init
380382

381383
#define PHP_MODULE_GLOBALS ZEND_MODULE_GLOBALS
382384

0 commit comments

Comments
 (0)