Skip to content

Commit 1f72dd8

Browse files
committed
Fix [-Wundef] warning in TSRM
1 parent ec1e854 commit 1f72dd8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

TSRM/TSRM.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int tsrm_error(int level, const char *format, ...);
7474
static int tsrm_error_level;
7575
static FILE *tsrm_error_file;
7676

77-
#if TSRM_DEBUG
77+
#ifdef TSRM_DEBUG
7878
#define TSRM_ERROR(args) tsrm_error args
7979
#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \
8080
{ \
@@ -102,7 +102,7 @@ static FILE *tsrm_error_file;
102102
}
103103
#endif
104104

105-
#if defined(TSRM_WIN32)
105+
#ifdef TSRM_WIN32
106106
static DWORD tls_key;
107107
# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what))
108108
# define tsrm_tls_get() TlsGetValue(tls_key)
@@ -118,7 +118,7 @@ TSRM_TLS uint8_t is_thread_shutdown = 0;
118118
/* Startup TSRM (call once for the entire process) */
119119
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
120120
{/*{{{*/
121-
#if defined(TSRM_WIN32)
121+
#ifdef TSRM_WIN32
122122
tls_key = TlsAlloc();
123123
#else
124124
pthread_key_create(&tls_key, 0);
@@ -209,7 +209,7 @@ TSRM_API void tsrm_shutdown(void)
209209
if (tsrm_error_file!=stderr) {
210210
fclose(tsrm_error_file);
211211
}
212-
#if defined(TSRM_WIN32)
212+
#ifdef TSRM_WIN32
213213
TlsFree(tls_key);
214214
#else
215215
pthread_setspecific(tls_key, 0);
@@ -677,7 +677,7 @@ TSRM_API void *tsrm_set_shutdown_handler(tsrm_shutdown_func_t shutdown_handler)
677677
* Debug support
678678
*/
679679

680-
#if TSRM_DEBUG
680+
#ifdef TSRM_DEBUG
681681
int tsrm_error(int level, const char *format, ...)
682682
{/*{{{*/
683683
if (level<=tsrm_error_level) {
@@ -702,7 +702,7 @@ void tsrm_error_set(int level, char *debug_filename)
702702
{/*{{{*/
703703
tsrm_error_level = level;
704704

705-
#if TSRM_DEBUG
705+
#ifdef TSRM_DEBUG
706706
if (tsrm_error_file!=stderr) { /* close files opened earlier */
707707
fclose(tsrm_error_file);
708708
}
@@ -758,7 +758,7 @@ TSRM_API uint8_t tsrm_is_shutdown(void)
758758

759759
TSRM_API const char *tsrm_api_name(void)
760760
{/*{{{*/
761-
#if defined(TSRM_WIN32)
761+
#ifdef TSRM_WIN32
762762
return "Windows Threads";
763763
#else
764764
return "POSIX Threads";

0 commit comments

Comments
 (0)