Skip to content

Commit cf43c19

Browse files
petknikic
authored andcommitted
Fix -Wundef warnings
- ZTS - PHP_WIN32 - HAVE_SIGACTION are either undefined or defined to 1. This fixes possible -Wundef (Windows C4668 warning code) warnings if such compiler configuration is set.
1 parent 4c43268 commit cf43c19

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

apc_cache.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS)
273273
result = php_var_unserialize(value, &tmp, buf + buf_len, &var_hash);
274274
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
275275
BG(serialize_lock)--;
276-
276+
277277
if (!result) {
278278
php_error_docref(NULL, E_NOTICE, "Error at offset %td of %zd bytes", tmp - buf, buf_len);
279279
ZVAL_NULL(value);
@@ -1210,7 +1210,7 @@ PHP_APCU_API zend_bool apc_cache_defense(apc_cache_t *cache, zend_string *key, t
12101210
last->len == ZSTR_LEN(key) &&
12111211
last->mtime == t &&
12121212
(last->owner_pid != owner_pid
1213-
#if ZTS
1213+
#ifdef ZTS
12141214
|| last->owner_thread != owner_thread
12151215
#endif
12161216
)

apc_signal.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "apc.h"
3636

37-
#if HAVE_SIGACTION
37+
#ifdef HAVE_SIGACTION
3838
#include <signal.h>
3939
#include "apc_globals.h"
4040
#include "apc_sma.h"

apc_sma.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ PHP_APCU_API void apc_sma_init(apc_sma_t* sma, void** data, apc_sma_expunge_f ex
331331
#else
332332
{
333333
int j = apc_shm_create(i, sma->size);
334-
#if PHP_WIN32
334+
#ifdef PHP_WIN32
335335
/* TODO remove the line below after 7.1 EOL. */
336336
SetLastError(0);
337337
#endif

php_apc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include "SAPI.h"
5959
#include "php_apc.h"
6060

61-
#if HAVE_SIGACTION
61+
#ifdef HAVE_SIGACTION
6262
#include "apc_signal.h"
6363
#endif
6464

@@ -300,7 +300,7 @@ static PHP_MSHUTDOWN_FUNCTION(apcu)
300300
APCG(initialized) = 0;
301301
}
302302

303-
#if HAVE_SIGACTION
303+
#ifdef HAVE_SIGACTION
304304
apc_shutdown_signals();
305305
#endif
306306
}
@@ -325,7 +325,7 @@ static PHP_RINIT_FUNCTION(apcu)
325325
apc_cache_serializer(apc_user_cache, APCG(serializer_name));
326326
}
327327

328-
#if HAVE_SIGACTION
328+
#ifdef HAVE_SIGACTION
329329
apc_set_signals();
330330
#endif
331331
}

0 commit comments

Comments
 (0)