diff options
| author | hachem <im@hachem.wtf> | 2024-11-29 21:33:19 +0100 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2024-11-29 21:33:19 +0100 |
| commit | ad5f458d31d45a09d3888f83a4f8a54eea20c996 (patch) | |
| tree | 275ed8bff2e0a23064bc2f3eee0a74de81b9c6b7 /src/core/log.h | |
| parent | 42100ac963a5de424a1407885599f049335036f9 (diff) | |
fix: cross platform build
Diffstat (limited to 'src/core/log.h')
| -rw-r--r-- | src/core/log.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/core/log.h b/src/core/log.h index 0cc98f9..6524426 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -8,12 +8,6 @@ #include <string_view> #include <utility> -#ifdef HSDBG_WINDOWS - #include <io.h> -#else - #include <unistd.h> -#endif - namespace Hsdbg::Log { enum class Level : uint8_t @@ -65,19 +59,7 @@ namespace Hsdbg::Log return ""; } - inline auto is_terminal(bool to_stderr) -> bool - { - constexpr int STDOUT_DESCRIPTOR = 1; - constexpr int STDERR_DESCRIPTOR = 2; - - const int descriptor = to_stderr ? STDERR_DESCRIPTOR : STDOUT_DESCRIPTOR; - -#ifdef HSDBG_WINDOWS - return _isatty(descriptor) != 0; -#else - return isatty(descriptor) != 0; -#endif - } + auto is_terminal(bool to_stderr) -> bool; inline auto write(Level level, std::string_view message) -> void { |
