Skip to content

Commit 888eb37

Browse files
authored
Fix -Wundef/C4668 warnings (#15853)
- ZTS is either undefined or defined (to 1) - PHP_WIN32 is either undefined or defined (to 1) - HAVE_LIBEDIT is either undefined or defined (to 1)
1 parent f6a232c commit 888eb37

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

Zend/zend_API.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2958,7 +2958,7 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
29582958
if (EG(active)) { // at run-time: this ought to only happen if registered with dl() or somehow temporarily at runtime
29592959
ZEND_MAP_PTR_INIT(internal_function->run_time_cache, zend_arena_calloc(&CG(arena), 1, zend_internal_run_time_cache_reserved_size()));
29602960
} else {
2961-
#if ZTS
2961+
#ifdef ZTS
29622962
ZEND_MAP_PTR_NEW_STATIC(internal_function->run_time_cache);
29632963
#else
29642964
ZEND_MAP_PTR_INIT(internal_function->run_time_cache, NULL);

Zend/zend_enum.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static void zend_enum_register_func(zend_class_entry *ce, zend_known_string_id n
421421
if (EG(active)) { // at run-time
422422
ZEND_MAP_PTR_INIT(zif->run_time_cache, zend_arena_calloc(&CG(arena), 1, zend_internal_run_time_cache_reserved_size()));
423423
} else {
424-
#if ZTS
424+
#ifdef ZTS
425425
ZEND_MAP_PTR_NEW_STATIC(zif->run_time_cache);
426426
#else
427427
ZEND_MAP_PTR_INIT(zif->run_time_cache, NULL);

ext/ffi/ffi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5393,7 +5393,7 @@ static zend_result ffi_fixup_temporaries(void) {
53935393
++zend_ffi_cast_fn.T;
53945394
++zend_ffi_type_fn.T;
53955395
}
5396-
#if !ZTS
5396+
#ifndef ZTS
53975397
ZEND_MAP_PTR(zend_ffi_new_fn.run_time_cache) = ZEND_MAP_PTR(((zend_internal_function *)zend_hash_str_find_ptr(&zend_ffi_ce->function_table, "new", sizeof("new")-1))->run_time_cache);
53985398
ZEND_MAP_PTR(zend_ffi_cast_fn.run_time_cache) = ZEND_MAP_PTR(((zend_internal_function *)zend_hash_str_find_ptr(&zend_ffi_ce->function_table, "cast", sizeof("cast")-1))->run_time_cache);
53995399
ZEND_MAP_PTR(zend_ffi_type_fn.run_time_cache) = ZEND_MAP_PTR(((zend_internal_function *)zend_hash_str_find_ptr(&zend_ffi_ce->function_table, "type", sizeof("type")-1))->run_time_cache);

ext/opcache/jit/zend_jit_ir.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4552,7 +4552,7 @@ static struct jit_observer_fcall_is_unobserved_data jit_observer_fcall_is_unobse
45524552
if (func && (func->common.fn_flags & ZEND_ACC_CLOSURE) == 0 && ZEND_MAP_PTR_IS_OFFSET(func->common.run_time_cache)) {
45534553
// JIT: ZEND_MAP_PTR_GET_IMM(func->common.runtime_cache)
45544554
run_time_cache = ir_LOAD_A(ir_ADD_OFFSET(ir_LOAD_A(jit_CG(map_ptr_base)), (uintptr_t)ZEND_MAP_PTR(func->common.run_time_cache)));
4555-
#if !ZTS
4555+
#ifndef ZTS
45564556
} else if (func && rx == IS_UNUSED) { // happens for internal functions only
45574557
ZEND_ASSERT(!ZEND_USER_CODE(func->type));
45584558
run_time_cache = ir_LOAD_A(ir_ADD_OFFSET(ir_CONST_ADDR(func), offsetof(zend_op_array, run_time_cache__ptr)));

ext/readline/readline.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ PHP_FUNCTION(readline_info)
186186
if (!try_convert_to_string(value)) {
187187
RETURN_THROWS();
188188
}
189-
#if !defined(PHP_WIN32) && !HAVE_LIBEDIT
189+
#if !defined(PHP_WIN32) && !defined(HAVE_LIBEDIT)
190190
if (!rl_line_buffer) {
191191
rl_line_buffer = malloc(Z_STRLEN_P(value) + 1);
192192
} else if (strlen(oldstr) < Z_STRLEN_P(value)) {

ext/xmlreader/php_xmlreader.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ static zend_result xmlreader_fixup_temporaries(void) {
12761276
++xmlreader_open_fn.T;
12771277
++xmlreader_xml_fn.T;
12781278
}
1279-
#if !ZTS
1279+
#ifndef ZTS
12801280
ZEND_MAP_PTR(xmlreader_open_fn.run_time_cache) = ZEND_MAP_PTR(((zend_internal_function *)zend_hash_str_find_ptr(&xmlreader_class_entry->function_table, "open", sizeof("open")-1))->run_time_cache);
12811281
ZEND_MAP_PTR(xmlreader_xml_fn.run_time_cache) = ZEND_MAP_PTR(((zend_internal_function *)zend_hash_str_find_ptr(&xmlreader_class_entry->function_table, "xml", sizeof("xml")-1))->run_time_cache);
12821282
#endif

main/network.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
207207
} else {
208208
php_error_docref(NULL, E_WARNING, "php_network_getaddresses: getaddrinfo for %s failed: %s", host, gai_error);
209209
}
210-
# if PHP_WIN32
210+
# ifdef PHP_WIN32
211211
php_win32_error_msg_free(gai_error);
212212
# endif
213213
return 0;

0 commit comments

Comments
 (0)