Skip to content

Commit

Permalink
Revert "logging: Do not use iostream under any circumstances"
Browse files Browse the repository at this point in the history
  • Loading branch information
ArsenArsen authored Jan 10, 2024
1 parent a24e99e commit 26088e9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/frg/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
#include <frg/macros.hpp>
#include <frg/detection.hpp>

#if __STDC_HOSTED__
# if __has_include(<iostream>)
# include <iostream>
# define FRIGG_HAS_IOSTREAM
# endif
#endif

namespace frg FRG_VISIBILITY {

struct endlog_t { };
Expand Down Expand Up @@ -158,7 +165,11 @@ struct ostream_out {
}

auto &operator<<(endlog_t) {
#ifdef FRIGG_HAS_IOSTREAM
output << std::endl;
#else
output << '\n';
#endif // FRIGG_HAS_IOSTREAM
return *this;
}
};
Expand Down

0 comments on commit 26088e9

Please sign in to comment.