Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion libcxx/src/print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
# include <windows.h>
#elif __has_include(<unistd.h>)
# include <unistd.h>
# if defined(_NEWLIB_VERSION)
# if defined(_POSIX_C_SOURCE) && __has_include(<stdio.h>)
# include <stdio.h>
# define HAS_FILENO_AND_ISATTY
# endif
# else
# define HAS_FILENO_AND_ISATTY
# endif
#endif

_LIBCPP_BEGIN_NAMESPACE_STD
Expand Down Expand Up @@ -56,7 +64,7 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst
}
# endif // _LIBCPP_HAS_WIDE_CHARACTERS

#elif __has_include(<unistd.h>) // !_LIBCPP_WIN32API
#elif defined(HAS_FILENO_AND_ISATTY) // !_LIBCPP_WIN32API

_LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream) { return isatty(fileno(__stream)); }
#endif
Expand Down
Loading