summaryrefslogtreecommitdiffhomepage
path: root/compat/debug.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-03 18:01:11 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-04 06:58:15 +0100
commita73f01a0cbedc578b169b4c74910dcde072d8451 (patch)
treefc4e051fff2826ab26637387be961aedcb427dfa /compat/debug.cpp
parentff8b35d8874ff6377b6a0aad494da46028668ac0 (diff)
compat/debug: allow Debug{&cerr} without <iostream>
Diffstat (limited to 'compat/debug.cpp')
-rw-r--r--compat/debug.cpp5
1 files changed, 5 insertions, 0 deletions
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 <cerrno>
#include <cstdio>
+#include <iostream>
#include <Corrade/Containers/StringView.h>
+
// 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}; }