]> granicus.if.org Git - php/commitdiff
Fix [-Wundef] warning in TSRM
authorGeorge Peter Banyard <girgias@php.net>
Wed, 20 May 2020 11:59:27 +0000 (13:59 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Wed, 20 May 2020 12:01:10 +0000 (14:01 +0200)
TSRM/TSRM.c

index acd1c395d775c9510122956987c48db4a9eede81..cd41b078a7fb03915f220e116c0639a1dc2c4471 100644 (file)
@@ -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";