diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-26 00:40:51 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-26 00:42:44 +0100 |
commit | cf7db48c261ee9c896c813a38ff8c59da5b8fe07 (patch) | |
tree | 41d827be5db5f3322d745215fe38a9c395a52fa3 /asl/print.cpp | |
parent | 79aaec3d7d12bc1a0483f19eadeda325a2d65920 (diff) |
Fix line endings
Diffstat (limited to 'asl/print.cpp')
-rw-r--r-- | asl/print.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/asl/print.cpp b/asl/print.cpp index 17f00c8..559dcbd 100644 --- a/asl/print.cpp +++ b/asl/print.cpp @@ -1,31 +1,31 @@ -#include "asl/print.hpp"
-
-#include <cstdio>
-
-// @Todo Optimize this, maybe make buffered
-class ConsoleWriter : public asl::Writer
-{
- FILE* m_handle;
-
-public:
- explicit ConsoleWriter(FILE* handle)
- : m_handle{handle}
- {}
-
- void write(asl::span<const asl::byte> s) override
- {
- fwrite(s.data(), 1, static_cast<size_t>(s.size()), m_handle);
- }
-};
-
-asl::Writer* asl::print_internals::get_stdout_writer()
-{
- static ConsoleWriter s_writer{stdout};
- return &s_writer;
-}
-
-asl::Writer* asl::print_internals::get_stderr_writer()
-{
- static ConsoleWriter s_writer{stderr};
- return &s_writer;
-}
+#include "asl/print.hpp" + +#include <cstdio> + +// @Todo Optimize this, maybe make buffered +class ConsoleWriter : public asl::Writer +{ + FILE* m_handle; + +public: + explicit ConsoleWriter(FILE* handle) + : m_handle{handle} + {} + + void write(asl::span<const asl::byte> s) override + { + fwrite(s.data(), 1, static_cast<size_t>(s.size()), m_handle); + } +}; + +asl::Writer* asl::print_internals::get_stdout_writer() +{ + static ConsoleWriter s_writer{stdout}; + return &s_writer; +} + +asl::Writer* asl::print_internals::get_stderr_writer() +{ + static ConsoleWriter s_writer{stderr}; + return &s_writer; +} |