From 25acc4a6b4bca5d49de7b97fad4afac37de5b751 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Tue, 12 May 2020 17:52:53 +0200 Subject: [PATCH] Fix [-Wundef] warning in Zend folder --- Zend/zend.c | 2 +- Zend/zend_API.h | 2 +- Zend/zend_hash.c | 4 ++-- Zend/zend_object_handlers.c | 2 +- Zend/zend_operators.c | 4 ++-- Zend/zend_operators.h | 2 +- Zend/zend_portability.h | 30 +++++++++++++++--------------- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index e20a26f8b0..4a9c939aa0 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -829,7 +829,7 @@ int zend_startup(zend_utility_functions *utility_functions) /* {{{ */ zend_interrupt_function = NULL; -#if HAVE_DTRACE +#ifdef HAVE_DTRACE /* build with dtrace support */ { char *tmp = getenv("USE_ZEND_DTRACE"); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 234aa9e99d..366f85c81f 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -204,7 +204,7 @@ typedef struct _zend_fcall_info_cache { #define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \ ts_allocate_id(&module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor); #define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v) ZEND_TSRMG(module_name##_globals_id, zend_##module_name##_globals *, v) -#if ZEND_ENABLE_STATIC_TSRMLS_CACHE +#ifdef ZEND_ENABLE_STATIC_TSRMLS_CACHE #define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK_STATIC(module_name##_globals_id, zend_##module_name##_globals *) #else #define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK(module_name##_globals_id, zend_##module_name##_globals *) diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index d57c0a69d2..ae67adcf0a 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -110,7 +110,7 @@ static void ZEND_FASTCALL zend_hash_do_resize(HashTable *ht); static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize) { -#if defined(ZEND_WIN32) +#ifdef ZEND_WIN32 unsigned long index; #endif @@ -122,7 +122,7 @@ static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize) zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket)); } -#if defined(ZEND_WIN32) +#ifdef ZEND_WIN32 if (BitScanReverse(&index, nSize - 1)) { return 0x2u << ((31 - index) ^ 0x1f); } else { diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index b0dea22555..7abc87d75e 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1389,7 +1389,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st } } while (0); -#if MBO_0 +#ifdef MBO_0 /* right now this function is used for non static method lookup too */ /* Is the function static */ if (UNEXPECTED(!(fbc->common.fn_flags & ZEND_ACC_STATIC))) { diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 44151fa7a2..53cc6e45ea 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -34,7 +34,7 @@ #include #endif -#if ZEND_USE_TOLOWER_L +#ifdef ZEND_USE_TOLOWER_L #include static _locale_t current_locale = NULL; /* this is true global! may lead to strange effects on ZTS, but so may setlocale() */ @@ -3125,7 +3125,7 @@ ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const } /* }}} */ -#if !ZEND_DVAL_TO_LVAL_CAST_OK +#ifndef ZEND_DVAL_TO_LVAL_CAST_OK # if SIZEOF_ZEND_LONG == 4 ZEND_API zend_long ZEND_FASTCALL zend_dval_to_lval_slow(double d) /* {{{ */ { diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index f3f5412805..2664514709 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -98,7 +98,7 @@ ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const # define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN)) #endif -#if ZEND_DVAL_TO_LVAL_CAST_OK +#ifdef ZEND_DVAL_TO_LVAL_CAST_OK static zend_always_inline zend_long zend_dval_to_lval(double d) { if (EXPECTED(zend_finite(d)) && EXPECTED(!zend_isnan(d))) { diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 8a278c93f1..bfa41a4ffe 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -318,7 +318,7 @@ char *alloca(); # endif #endif /* ZEND_DEBUG */ -#if PHP_HAVE_BUILTIN_EXPECT +#ifdef PHP_HAVE_BUILTIN_EXPECT # define EXPECTED(condition) __builtin_expect(!!(condition), 1) # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) #else @@ -351,7 +351,7 @@ char *alloca(); #endif -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) +#if (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) # define ZEND_ALLOCA_MAX_SIZE (32 * 1024) # define ALLOCA_FLAG(name) \ zend_bool name; @@ -524,14 +524,14 @@ extern "C++" { #endif /* Do not use for conditional declaration of API functions! */ -#if ZEND_INTRIN_SSSE3_RESOLVER && ZEND_INTRIN_HAVE_IFUNC_TARGET +#if defined(ZEND_INTRIN_SSSE3_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) # define ZEND_INTRIN_SSSE3_FUNC_PROTO 1 -#elif ZEND_INTRIN_SSSE3_RESOLVER +#elif defined(ZEND_INTRIN_SSSE3_RESOLVER) # define ZEND_INTRIN_SSSE3_FUNC_PTR 1 #endif -#if ZEND_INTRIN_SSSE3_RESOLVER -# if defined(HAVE_FUNC_ATTRIBUTE_TARGET) +#ifdef ZEND_INTRIN_SSSE3_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET # define ZEND_INTRIN_SSSE3_FUNC_DECL(func) ZEND_API func __attribute__((target("ssse3"))) # else # define ZEND_INTRIN_SSSE3_FUNC_DECL(func) func @@ -549,14 +549,14 @@ extern "C++" { #endif /* Do not use for conditional declaration of API functions! */ -#if ZEND_INTRIN_SSE4_2_RESOLVER && ZEND_INTRIN_HAVE_IFUNC_TARGET +#if defined(ZEND_INTRIN_SSE4_2_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) # define ZEND_INTRIN_SSE4_2_FUNC_PROTO 1 -#elif ZEND_INTRIN_SSE4_2_RESOLVER +#elif defined(ZEND_INTRIN_SSE4_2_RESOLVER) # define ZEND_INTRIN_SSE4_2_FUNC_PTR 1 #endif -#if ZEND_INTRIN_SSE4_2_RESOLVER -# if defined(HAVE_FUNC_ATTRIBUTE_TARGET) +#ifdef ZEND_INTRIN_SSE4_2_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET # define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) ZEND_API func __attribute__((target("sse4.2"))) # else # define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) func @@ -572,14 +572,14 @@ extern "C++" { #endif /* Do not use for conditional declaration of API functions! */ -#if ZEND_INTRIN_AVX2_RESOLVER && ZEND_INTRIN_HAVE_IFUNC_TARGET +#if defined(ZEND_INTRIN_AVX2_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) # define ZEND_INTRIN_AVX2_FUNC_PROTO 1 -#elif ZEND_INTRIN_AVX2_RESOLVER +#elif defined(ZEND_INTRIN_AVX2_RESOLVER) # define ZEND_INTRIN_AVX2_FUNC_PTR 1 #endif -#if ZEND_INTRIN_AVX2_RESOLVER -# if defined(HAVE_FUNC_ATTRIBUTE_TARGET) +#ifdef ZEND_INTRIN_AVX2_RESOLVER +# ifdef HAVE_FUNC_ATTRIBUTE_TARGET # define ZEND_INTRIN_AVX2_FUNC_DECL(func) ZEND_API func __attribute__((target("avx2"))) # else # define ZEND_INTRIN_AVX2_FUNC_DECL(func) func @@ -592,7 +592,7 @@ extern "C++" { #ifdef ZEND_WIN32 # define ZEND_SET_ALIGNED(alignment, decl) __declspec(align(alignment)) decl -#elif HAVE_ATTRIBUTE_ALIGNED +#elif defined(HAVE_ATTRIBUTE_ALIGNED) # define ZEND_SET_ALIGNED(alignment, decl) decl __attribute__ ((__aligned__ (alignment))) #else # define ZEND_SET_ALIGNED(alignment, decl) decl -- 2.50.1