Skip to content

Commit 25acc4a

Browse files
committed
Fix [-Wundef] warning in Zend folder
1 parent 8e66d22 commit 25acc4a

7 files changed

+23
-23
lines changed

Zend/zend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ int zend_startup(zend_utility_functions *utility_functions) /* {{{ */
829829

830830
zend_interrupt_function = NULL;
831831

832-
#if HAVE_DTRACE
832+
#ifdef HAVE_DTRACE
833833
/* build with dtrace support */
834834
{
835835
char *tmp = getenv("USE_ZEND_DTRACE");

Zend/zend_API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ typedef struct _zend_fcall_info_cache {
204204
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
205205
ts_allocate_id(&module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
206206
#define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v) ZEND_TSRMG(module_name##_globals_id, zend_##module_name##_globals *, v)
207-
#if ZEND_ENABLE_STATIC_TSRMLS_CACHE
207+
#ifdef ZEND_ENABLE_STATIC_TSRMLS_CACHE
208208
#define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK_STATIC(module_name##_globals_id, zend_##module_name##_globals *)
209209
#else
210210
#define ZEND_MODULE_GLOBALS_BULK(module_name) TSRMG_BULK(module_name##_globals_id, zend_##module_name##_globals *)

Zend/zend_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void ZEND_FASTCALL zend_hash_do_resize(HashTable *ht);
110110

111111
static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize)
112112
{
113-
#if defined(ZEND_WIN32)
113+
#ifdef ZEND_WIN32
114114
unsigned long index;
115115
#endif
116116

@@ -122,7 +122,7 @@ static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize)
122122
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket));
123123
}
124124

125-
#if defined(ZEND_WIN32)
125+
#ifdef ZEND_WIN32
126126
if (BitScanReverse(&index, nSize - 1)) {
127127
return 0x2u << ((31 - index) ^ 0x1f);
128128
} else {

Zend/zend_object_handlers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
13891389
}
13901390
} while (0);
13911391

1392-
#if MBO_0
1392+
#ifdef MBO_0
13931393
/* right now this function is used for non static method lookup too */
13941394
/* Is the function static */
13951395
if (UNEXPECTED(!(fbc->common.fn_flags & ZEND_ACC_STATIC))) {

Zend/zend_operators.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <emmintrin.h>
3535
#endif
3636

37-
#if ZEND_USE_TOLOWER_L
37+
#ifdef ZEND_USE_TOLOWER_L
3838
#include <locale.h>
3939
static _locale_t current_locale = NULL;
4040
/* 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
31253125
}
31263126
/* }}} */
31273127

3128-
#if !ZEND_DVAL_TO_LVAL_CAST_OK
3128+
#ifndef ZEND_DVAL_TO_LVAL_CAST_OK
31293129
# if SIZEOF_ZEND_LONG == 4
31303130
ZEND_API zend_long ZEND_FASTCALL zend_dval_to_lval_slow(double d) /* {{{ */
31313131
{

Zend/zend_operators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const
9898
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN))
9999
#endif
100100

101-
#if ZEND_DVAL_TO_LVAL_CAST_OK
101+
#ifdef ZEND_DVAL_TO_LVAL_CAST_OK
102102
static zend_always_inline zend_long zend_dval_to_lval(double d)
103103
{
104104
if (EXPECTED(zend_finite(d)) && EXPECTED(!zend_isnan(d))) {

Zend/zend_portability.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ char *alloca();
318318
# endif
319319
#endif /* ZEND_DEBUG */
320320

321-
#if PHP_HAVE_BUILTIN_EXPECT
321+
#ifdef PHP_HAVE_BUILTIN_EXPECT
322322
# define EXPECTED(condition) __builtin_expect(!!(condition), 1)
323323
# define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
324324
#else
@@ -351,7 +351,7 @@ char *alloca();
351351

352352
#endif
353353

354-
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
354+
#if (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
355355
# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
356356
# define ALLOCA_FLAG(name) \
357357
zend_bool name;
@@ -524,14 +524,14 @@ extern "C++" {
524524
#endif
525525

526526
/* Do not use for conditional declaration of API functions! */
527-
#if ZEND_INTRIN_SSSE3_RESOLVER && ZEND_INTRIN_HAVE_IFUNC_TARGET
527+
#if defined(ZEND_INTRIN_SSSE3_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET)
528528
# define ZEND_INTRIN_SSSE3_FUNC_PROTO 1
529-
#elif ZEND_INTRIN_SSSE3_RESOLVER
529+
#elif defined(ZEND_INTRIN_SSSE3_RESOLVER)
530530
# define ZEND_INTRIN_SSSE3_FUNC_PTR 1
531531
#endif
532532

533-
#if ZEND_INTRIN_SSSE3_RESOLVER
534-
# if defined(HAVE_FUNC_ATTRIBUTE_TARGET)
533+
#ifdef ZEND_INTRIN_SSSE3_RESOLVER
534+
# ifdef HAVE_FUNC_ATTRIBUTE_TARGET
535535
# define ZEND_INTRIN_SSSE3_FUNC_DECL(func) ZEND_API func __attribute__((target("ssse3")))
536536
# else
537537
# define ZEND_INTRIN_SSSE3_FUNC_DECL(func) func
@@ -549,14 +549,14 @@ extern "C++" {
549549
#endif
550550

551551
/* Do not use for conditional declaration of API functions! */
552-
#if ZEND_INTRIN_SSE4_2_RESOLVER && ZEND_INTRIN_HAVE_IFUNC_TARGET
552+
#if defined(ZEND_INTRIN_SSE4_2_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET)
553553
# define ZEND_INTRIN_SSE4_2_FUNC_PROTO 1
554-
#elif ZEND_INTRIN_SSE4_2_RESOLVER
554+
#elif defined(ZEND_INTRIN_SSE4_2_RESOLVER)
555555
# define ZEND_INTRIN_SSE4_2_FUNC_PTR 1
556556
#endif
557557

558-
#if ZEND_INTRIN_SSE4_2_RESOLVER
559-
# if defined(HAVE_FUNC_ATTRIBUTE_TARGET)
558+
#ifdef ZEND_INTRIN_SSE4_2_RESOLVER
559+
# ifdef HAVE_FUNC_ATTRIBUTE_TARGET
560560
# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) ZEND_API func __attribute__((target("sse4.2")))
561561
# else
562562
# define ZEND_INTRIN_SSE4_2_FUNC_DECL(func) func
@@ -572,14 +572,14 @@ extern "C++" {
572572
#endif
573573

574574
/* Do not use for conditional declaration of API functions! */
575-
#if ZEND_INTRIN_AVX2_RESOLVER && ZEND_INTRIN_HAVE_IFUNC_TARGET
575+
#if defined(ZEND_INTRIN_AVX2_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET)
576576
# define ZEND_INTRIN_AVX2_FUNC_PROTO 1
577-
#elif ZEND_INTRIN_AVX2_RESOLVER
577+
#elif defined(ZEND_INTRIN_AVX2_RESOLVER)
578578
# define ZEND_INTRIN_AVX2_FUNC_PTR 1
579579
#endif
580580

581-
#if ZEND_INTRIN_AVX2_RESOLVER
582-
# if defined(HAVE_FUNC_ATTRIBUTE_TARGET)
581+
#ifdef ZEND_INTRIN_AVX2_RESOLVER
582+
# ifdef HAVE_FUNC_ATTRIBUTE_TARGET
583583
# define ZEND_INTRIN_AVX2_FUNC_DECL(func) ZEND_API func __attribute__((target("avx2")))
584584
# else
585585
# define ZEND_INTRIN_AVX2_FUNC_DECL(func) func
@@ -592,7 +592,7 @@ extern "C++" {
592592

593593
#ifdef ZEND_WIN32
594594
# define ZEND_SET_ALIGNED(alignment, decl) __declspec(align(alignment)) decl
595-
#elif HAVE_ATTRIBUTE_ALIGNED
595+
#elif defined(HAVE_ATTRIBUTE_ALIGNED)
596596
# define ZEND_SET_ALIGNED(alignment, decl) decl __attribute__ ((__aligned__ (alignment)))
597597
#else
598598
# define ZEND_SET_ALIGNED(alignment, decl) decl

0 commit comments

Comments
 (0)