Skip to content

Commit

Permalink
wpi::println: Flush stdout on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Nov 7, 2024
1 parent 83fa422 commit 51eb0ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wpiutil/src/main/native/include/wpi/print.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ template <typename... T>
inline void println(fmt::format_string<T...> fmt, T&&... args) {
try {
fmt::println(fmt, std::forward<T>(args)...);
#ifdef _WIN32
std::fflush(stdout);
#endif
} catch (const std::system_error&) {
}
}
Expand All @@ -57,6 +60,9 @@ inline void println(std::FILE* f, fmt::format_string<T...> fmt, T&&... args) {
try {
fmt::println(f, fmt, std::forward<T>(args)...);
} catch (const std::system_error&) {
#ifdef _WIN32
std::fflush(stdout);
#endif
}
}

Expand Down

0 comments on commit 51eb0ec

Please sign in to comment.