From 9eeed7d0012ba7a19a2d6f7f6b3f9c7c83ed86f3 Mon Sep 17 00:00:00 2001 From: Kamil Becmer Date: Sat, 15 Feb 2020 17:17:52 +0100 Subject: [PATCH] Don't assign stderr on non-glibc Signed-off-by: Kamil Becmer --- tests/tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/tests.c b/tests/tests.c index 579b562..8161eba 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -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) { -- 2.39.5