Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/platform/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if defined(_WIN32)
#undef IS_WINDOWS
#define IS_WINDOWS 1
#elif defined(__linux)
#elif defined(__linux) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#undef IS_LINUX
#define IS_LINUX 1
#elif defined(__APPLE__)
Expand Down
12 changes: 5 additions & 7 deletions src/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ namespace detail {
#endif
}

int fileno(std::FILE* stream) {
#if IS_WINDOWS
return _fileno(stream);
#else
return ::fileno(stream);
#endif
}
#if IS_WINDOWS
int fileno(std::FILE* stream) {
return _fileno(stream);
}
#endif

void enable_virtual_terminal_processing_if_needed() noexcept {
// enable colors / ansi processing if necessary
Expand Down
4 changes: 3 additions & 1 deletion src/utils/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
CPPTRACE_BEGIN_NAMESPACE
namespace detail {
bool isatty(int fd);
int fileno(std::FILE* stream);
#if IS_WINDOWS
int fileno(std::FILE* stream);
#endif

void enable_virtual_terminal_processing_if_needed() noexcept;

Expand Down
Loading