summaryrefslogtreecommitdiff
path: root/asl/print_win32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'asl/print_win32.cpp')
-rw-r--r--asl/print_win32.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/asl/print_win32.cpp b/asl/print_win32.cpp
deleted file mode 100644
index 45939b2..0000000
--- a/asl/print_win32.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "asl/print.hpp"
-
-#define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
-
-// @Todo Optimize this, maybe make buffered
-class Win32ConsoleWriter : public asl::writer
-{
- HANDLE m_handle;
-
-public:
- explicit Win32ConsoleWriter(HANDLE handle)
- : m_handle{handle}
- {}
-
- void write(const char* str, int64_t len) override
- {
- ::WriteConsoleA(m_handle, str, static_cast<DWORD>(len), nullptr, nullptr);
- }
-};
-
-asl::writer* asl::print_internals::get_stdout_writer()
-{
- static Win32ConsoleWriter writer{::GetStdHandle(STD_OUTPUT_HANDLE)};
- return &writer;
-}
-
-asl::writer* asl::print_internals::get_stderr_writer()
-{
- static Win32ConsoleWriter writer{::GetStdHandle(STD_ERROR_HANDLE)};
- return &writer;
-}
-