diff --git a/include/frg/logging.hpp b/include/frg/logging.hpp index 8d57e33..5c73cff 100644 --- a/include/frg/logging.hpp +++ b/include/frg/logging.hpp @@ -6,6 +6,13 @@ #include #include +#if __STDC_HOSTED__ +# if __has_include() +# include +# define FRIGG_HAS_IOSTREAM +# endif +#endif + namespace frg FRG_VISIBILITY { struct endlog_t { }; @@ -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; } };