]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
usage of fileno() only on POSIX and Windows
authorinikep <inikep@gmail.com>
Wed, 25 May 2016 10:41:41 +0000 (12:41 +0200)
committerinikep <inikep@gmail.com>
Wed, 25 May 2016 10:41:41 +0000 (12:41 +0200)
programs/zbufftest.c
programs/zstdcli.c

index fce0ab27559e2c05e641bafccf9189218308eed3..c780b8f4e5d9124516a75dbc8974cf32e14178c8 100644 (file)
@@ -262,8 +262,6 @@ static size_t FUZ_randomLength(U32* seed, U32 maxLog)
     return FUZ_rLogLength(seed, logLength);
 }
 
-#define MIN(a,b)   ( (a) < (b) ? (a) : (b) )
-
 #define CHECK(cond, ...) if (cond) { DISPLAY("Error => "); DISPLAY(__VA_ARGS__); \
                          DISPLAY(" (seed %u, test nb %u)  \n", seed, testNb); goto _output_error; }
 
index 13ff7955d8781911cf2732f3631612ea1c21f26e..2151578738972920a1d92b3ac853233f1a02a81c 100644 (file)
 #  include <io.h>       /* _isatty */
 #  define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
 #else
-   extern int fileno(FILE *stream);  /* triggers fileno() within <stdio.h> on POSIX */
+#if _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
 #  include <unistd.h>   /* isatty */
 #  define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
+#else
+#  define IS_CONSOLE(stdStream) 0
+#endif
 #endif