summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-05-20 13:59:27 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-05-20 14:01:10 +0200
commit1f72dd89a5f80663f25f9cf2981781e8fd9f73d4 (patch)
treef757f72ced980b6748bb57021e3d4a4788423bb0 /TSRM
parentec1e8540d8854a7309ecdbdc42dbffd3ea66bbd1 (diff)
downloadphp-git-1f72dd89a5f80663f25f9cf2981781e8fd9f73d4.tar.gz
Fix [-Wundef] warning in TSRM
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/TSRM.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index acd1c395d7..cd41b078a7 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -74,7 +74,7 @@ int tsrm_error(int level, const char *format, ...);
static int tsrm_error_level;
static FILE *tsrm_error_file;
-#if TSRM_DEBUG
+#ifdef TSRM_DEBUG
#define TSRM_ERROR(args) tsrm_error args
#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \
{ \
@@ -102,7 +102,7 @@ static FILE *tsrm_error_file;
}
#endif
-#if defined(TSRM_WIN32)
+#ifdef TSRM_WIN32
static DWORD tls_key;
# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what))
# define tsrm_tls_get() TlsGetValue(tls_key)
@@ -118,7 +118,7 @@ TSRM_TLS uint8_t is_thread_shutdown = 0;
/* Startup TSRM (call once for the entire process) */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
{/*{{{*/
-#if defined(TSRM_WIN32)
+#ifdef TSRM_WIN32
tls_key = TlsAlloc();
#else
pthread_key_create(&tls_key, 0);
@@ -209,7 +209,7 @@ TSRM_API void tsrm_shutdown(void)
if (tsrm_error_file!=stderr) {
fclose(tsrm_error_file);
}
-#if defined(TSRM_WIN32)
+#ifdef TSRM_WIN32
TlsFree(tls_key);
#else
pthread_setspecific(tls_key, 0);
@@ -677,7 +677,7 @@ TSRM_API void *tsrm_set_shutdown_handler(tsrm_shutdown_func_t shutdown_handler)
* Debug support
*/
-#if TSRM_DEBUG
+#ifdef TSRM_DEBUG
int tsrm_error(int level, const char *format, ...)
{/*{{{*/
if (level<=tsrm_error_level) {
@@ -702,7 +702,7 @@ void tsrm_error_set(int level, char *debug_filename)
{/*{{{*/
tsrm_error_level = level;
-#if TSRM_DEBUG
+#ifdef TSRM_DEBUG
if (tsrm_error_file!=stderr) { /* close files opened earlier */
fclose(tsrm_error_file);
}
@@ -758,7 +758,7 @@ TSRM_API uint8_t tsrm_is_shutdown(void)
TSRM_API const char *tsrm_api_name(void)
{/*{{{*/
-#if defined(TSRM_WIN32)
+#ifdef TSRM_WIN32
return "Windows Threads";
#else
return "POSIX Threads";