From 1f72dd89a5f80663f25f9cf2981781e8fd9f73d4 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Wed, 20 May 2020 13:59:27 +0200 Subject: Fix [-Wundef] warning in TSRM --- TSRM/TSRM.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'TSRM') 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"; -- cgit v1.2.1