From a73f01a0cbedc578b169b4c74910dcde072d8451 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 3 Mar 2024 18:01:11 +0100 Subject: compat/debug: allow Debug{&cerr} without --- compat/debug.cpp | 5 +++++ compat/debug.hpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/compat/debug.cpp b/compat/debug.cpp index 2b900180..d7a28289 100644 --- a/compat/debug.cpp +++ b/compat/debug.cpp @@ -2,8 +2,10 @@ #include "compat/strerror.hpp" #include #include +#include #include + // Error{} << "error" << colon() << "can't open file" << colon() << quoted("foo") << error_string(EINVAL); // ===> "error: can't open file 'foo': Invalid argument" @@ -64,6 +66,9 @@ Debug& operator<<(Debug& dbg, Fraction f) namespace floormat { +std::ostream* standard_output() { return &std::cout; } +std::ostream* standard_error() { return &std::cerr; } + using namespace floormat::detail::corrade_debug; Colon colon(char c) { return Colon{c}; } diff --git a/compat/debug.hpp b/compat/debug.hpp index 9fd0f2a9..7d1c6718 100644 --- a/compat/debug.hpp +++ b/compat/debug.hpp @@ -57,6 +57,9 @@ Debug& operator<<(Debug& dbg, Fraction frac); namespace floormat { +std::ostream* standard_output(); +std::ostream* standard_error(); + floormat::detail::corrade_debug::Colon colon(char c = ':'); floormat::detail::corrade_debug::ErrorString error_string(int error); floormat::detail::corrade_debug::ErrorString error_string(); -- cgit v1.2.3