mirror of
https://github.com/facebook/zstd.git
synced 2025-08-08 17:22:10 +03:00
usage of fileno() only on POSIX and Windows
This commit is contained in:
@@ -52,9 +52,12 @@
|
||||
# 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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user