diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 2319862488ca6..2376118ff105c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2958,7 +2958,7 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend if (EG(active)) { // at run-time: this ought to only happen if registered with dl() or somehow temporarily at runtime ZEND_MAP_PTR_INIT(internal_function->run_time_cache, zend_arena_calloc(&CG(arena), 1, zend_internal_run_time_cache_reserved_size())); } else { -#if ZTS +#ifdef ZTS ZEND_MAP_PTR_NEW_STATIC(internal_function->run_time_cache); #else ZEND_MAP_PTR_INIT(internal_function->run_time_cache, NULL); diff --git a/Zend/zend_enum.c b/Zend/zend_enum.c index 8676d1166cf3a..eb12ece50b451 100644 --- a/Zend/zend_enum.c +++ b/Zend/zend_enum.c @@ -421,7 +421,7 @@ static void zend_enum_register_func(zend_class_entry *ce, zend_known_string_id n if (EG(active)) { // at run-time ZEND_MAP_PTR_INIT(zif->run_time_cache, zend_arena_calloc(&CG(arena), 1, zend_internal_run_time_cache_reserved_size())); } else { -#if ZTS +#ifdef ZTS ZEND_MAP_PTR_NEW_STATIC(zif->run_time_cache); #else ZEND_MAP_PTR_INIT(zif->run_time_cache, NULL); diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 4e5dfc632c9ba..38d413c504371 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -5393,7 +5393,7 @@ static zend_result ffi_fixup_temporaries(void) { ++zend_ffi_cast_fn.T; ++zend_ffi_type_fn.T; } -#if !ZTS +#ifndef ZTS 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); 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); 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); diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index b24b61748456e..64681a332669a 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -4544,7 +4544,7 @@ static struct jit_observer_fcall_is_unobserved_data jit_observer_fcall_is_unobse if (func && (func->common.fn_flags & ZEND_ACC_CLOSURE) == 0 && ZEND_MAP_PTR_IS_OFFSET(func->common.run_time_cache)) { // JIT: ZEND_MAP_PTR_GET_IMM(func->common.runtime_cache) 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))); -#if !ZTS +#ifndef ZTS } else if (func && rx == IS_UNUSED) { // happens for internal functions only ZEND_ASSERT(!ZEND_USER_CODE(func->type)); run_time_cache = ir_LOAD_A(ir_ADD_OFFSET(ir_CONST_ADDR(func), offsetof(zend_op_array, run_time_cache__ptr))); diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 9745b0d68db33..d94e20db9c32d 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -186,7 +186,7 @@ PHP_FUNCTION(readline_info) if (!try_convert_to_string(value)) { RETURN_THROWS(); } -#if !defined(PHP_WIN32) && !HAVE_LIBEDIT +#if !defined(PHP_WIN32) && !defined(HAVE_LIBEDIT) if (!rl_line_buffer) { rl_line_buffer = malloc(Z_STRLEN_P(value) + 1); } else if (strlen(oldstr) < Z_STRLEN_P(value)) { diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index e8f63bade5bef..3f834b7155133 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -1276,7 +1276,7 @@ static zend_result xmlreader_fixup_temporaries(void) { ++xmlreader_open_fn.T; ++xmlreader_xml_fn.T; } -#if !ZTS +#ifndef ZTS 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); 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); #endif diff --git a/main/network.c b/main/network.c index fd2e49d79d20b..7d45cc8b78e90 100644 --- a/main/network.c +++ b/main/network.c @@ -207,7 +207,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka } else { php_error_docref(NULL, E_WARNING, "php_network_getaddresses: getaddrinfo for %s failed: %s", host, gai_error); } -# if PHP_WIN32 +# ifdef PHP_WIN32 php_win32_error_msg_free(gai_error); # endif return 0;