]> granicus.if.org Git - php/commitdiff
Fix [-Wundef] warning in Zend folder
authorGeorge Peter Banyard <girgias@php.net>
Tue, 12 May 2020 15:52:53 +0000 (17:52 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Tue, 12 May 2020 20:01:51 +0000 (22:01 +0200)
Zend/zend.c
Zend/zend_API.h
Zend/zend_hash.c
Zend/zend_object_handlers.c
Zend/zend_operators.c
Zend/zend_operators.h
Zend/zend_portability.h

index e20a26f8b0c55a5b68851975080f711c17453e3d..4a9c939aa0033b9d6cd3b5d8ab8315b17b7125ab 100644 (file)
@@ -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");
index 234aa9e99d67019c797ad4513bcb953cad8ec83f..366f85c81f08f38e702b99f5c7265fcd3dfeb498 100644 (file)
@@ -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 *)
index d57c0a69d2e030fc1453fe6c7384c7641908cc89..ae67adcf0a900044995f0681a7e2c374f87d252e 100644 (file)
@@ -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 {
index b0dea2255546ae4b7cc34b15f3a1ada12f5060f0..7abc87d75ec7c477dd77f274c69c690efa117426 100644 (file)
@@ -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))) {
index 44151fa7a2c85929c9b83d8e271bb79f3ac999af..53cc6e45eafe40fb35b04ccf030333cc1f1ec474 100644 (file)
@@ -34,7 +34,7 @@
 #include <emmintrin.h>
 #endif
 
-#if ZEND_USE_TOLOWER_L
+#ifdef ZEND_USE_TOLOWER_L
 #include <locale.h>
 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) /* {{{ */
 {
index f3f5412805b6e05830f579e414004365f464ef62..2664514709c7ac552ef7219dc335cc8602d09486 100644 (file)
@@ -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))) {
index 8a278c93f1919501e2f225a7f1f6fd30567ce8b3..bfa41a4ffede80c6d3a76474d7cc6987faf5613c 100644 (file)
@@ -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