Commit 9eeed7d0012ba7a19a2d6f7f6b3f9c7c83ed86f3
authorKamil Becmer <kamil.becmer@gmail.com>
Sat, 15 Feb 2020 16:17:52 +0000 (17:17 +0100)
committerKamil Becmer <kamil.becmer@gmail.com>
Sat, 15 Feb 2020 16:44:12 +0000 (17:44 +0100)
Signed-off-by: Kamil Becmer <kamil.becmer@gmail.com>
tests/tests.c

index 579b562d326725a9915d5b1feca19271b8767ca4..8161ebad4ff79028d7a51386861e55551f8244a3 100644 (file)
@@ -16,10 +16,7 @@ int tests_disable_stdout = 1;
 static char *test_name = "(uninitialized test)";
 static int finished = 0;
 
-#ifdef __MINGW32__
-#define restore_stderr()       {}
-#define map_stderr()           {}
-#else
+#if defined(__GLIBC__) && !defined(__MINGW32__)
 static FILE *orig_stderr = NULL;
 #define restore_stderr()       { if (orig_stderr) stderr = orig_stderr; }
 #define map_stderr()           { if (tests_disable_stdout) { \
@@ -27,6 +24,9 @@ static FILE *orig_stderr = NULL;
                                                                fclose(stdout);                 \
                                                                stderr = stdout;                \
                                                        } }
+#else
+#define restore_stderr()       {}
+#define map_stderr()           {}
 #endif
 
 static void atexit_handler(void) {