Skip to content

Commit 65f946b

Browse files
committed
use MINIT API for missing type arg
1 parent 69e0000 commit 65f946b

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

ext-src/php_swoole.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,14 +771,14 @@ PHP_MINIT_FUNCTION(openswoole) {
771771
swoole_error, "Swoole\\Error", "swoole_error", nullptr, nullptr, zend_ce_error, zend_get_std_object_handlers());
772772

773773
/** <Sort by dependency> **/
774-
php_swoole_event_minit(module_number);
774+
ZEND_MINIT(swoole_event)(INIT_FUNC_ARGS_PASSTHRU);
775775
// base
776776
php_swoole_atomic_minit(module_number);
777777
php_swoole_lock_minit(module_number);
778778
php_swoole_process_minit(module_number);
779779
php_swoole_process_pool_minit(module_number);
780780
php_swoole_table_minit(module_number);
781-
php_swoole_timer_minit(module_number);
781+
ZEND_MINIT(swoole_timer)(INIT_FUNC_ARGS_PASSTHRU);
782782
// coroutine
783783
php_swoole_coroutine_minit(module_number);
784784
php_swoole_coroutine_system_minit(module_number);

ext-src/php_swoole_private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ PHP_FUNCTION(swoole_async_dns_lookup_coro);
204204
* MINIT <Sort by dependency>
205205
* ==============================================================
206206
*/
207-
void php_swoole_event_minit(int module_number);
207+
extern PHP_MINIT_FUNCTION(swoole_event);
208208
// base
209209
void php_swoole_atomic_minit(int module_number);
210210
void php_swoole_lock_minit(int module_number);
211211
void php_swoole_process_minit(int module_number);
212212
void php_swoole_process_pool_minit(int module_number);
213213
void php_swoole_table_minit(int module_number);
214-
void php_swoole_timer_minit(int module_number);
214+
extern PHP_MINIT_FUNCTION(swoole_timer);
215215
// coroutine
216216
void php_swoole_coroutine_minit(int module_number);
217217
void php_swoole_coroutine_system_minit(int module_number);

ext-src/swoole_event.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,13 @@ static const zend_function_entry swoole_event_funcs[] =
9494
};
9595
// clang-format on
9696

97-
void php_swoole_event_minit(int module_number) {
97+
extern PHP_MINIT_FUNCTION(swoole_event) {
9898
SW_INIT_CLASS_ENTRY(swoole_event, "Swoole\\Event", "swoole_event", nullptr, swoole_event_methods);
9999
SW_SET_CLASS_CREATE(swoole_event, sw_zend_create_object_deny);
100100

101-
zend_register_functions(NULL, swoole_event_funcs, NULL, MODULE_PERSISTENT);
101+
zend_register_functions(NULL, swoole_event_funcs, NULL, type);
102+
103+
return SUCCESS;
102104
}
103105

104106
static void event_object_free(void *data) {

ext-src/swoole_timer.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static const zend_function_entry swoole_timer_funcs[] =
7878
};
7979
// clang-format on
8080

81-
void php_swoole_timer_minit(int module_number) {
81+
extern PHP_MINIT_FUNCTION(swoole_timer) {
8282
SW_INIT_CLASS_ENTRY(swoole_timer, "Swoole\\Timer", "swoole_timer", nullptr, swoole_timer_methods);
8383
SW_SET_CLASS_CREATE(swoole_timer, sw_zend_create_object_deny);
8484

@@ -89,12 +89,14 @@ void php_swoole_timer_minit(int module_number) {
8989
nullptr,
9090
spl_ce_ArrayIterator);
9191

92-
zend_register_functions(NULL, swoole_timer_funcs, NULL, MODULE_PERSISTENT);
92+
zend_register_functions(NULL, swoole_timer_funcs, NULL, type);
9393

9494
SW_REGISTER_LONG_CONSTANT("SWOOLE_TIMER_MIN_MS", SW_TIMER_MIN_MS);
9595
SW_REGISTER_DOUBLE_CONSTANT("SWOOLE_TIMER_MIN_SEC", SW_TIMER_MIN_SEC);
9696
SW_REGISTER_LONG_CONSTANT("SWOOLE_TIMER_MAX_MS", SW_TIMER_MAX_MS);
9797
SW_REGISTER_DOUBLE_CONSTANT("SWOOLE_TIMER_MAX_SEC", SW_TIMER_MAX_SEC);
98+
99+
return SUCCESS;
98100
}
99101

100102
static void timer_dtor(TimerNode *tnode) {

0 commit comments

Comments
 (0)