Skip to content

Commit

Permalink
Revert "Catch fmt::print throwing std::system_error when it cannot wr…
Browse files Browse the repository at this point in the history
…ite to STDOUT (fixes nba-emu#301)"

This reverts commit ff8f402.
  • Loading branch information
GranMinigun committed Dec 8, 2023
1 parent 470f1f4 commit 0b5a2f7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 30 deletions.
1 change: 0 additions & 1 deletion src/nba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ set(HEADERS_PUBLIC
include/nba/core.hpp
include/nba/integer.hpp
include/nba/log.hpp
include/nba/print.hpp
include/nba/save_state.hpp
include/nba/scheduler.hpp
)
Expand Down
3 changes: 1 addition & 2 deletions src/nba/include/nba/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <fmt/format.h>
#include <string_view>
#include <utility>
#include <nba/print.hpp>

namespace nba {

Expand Down Expand Up @@ -48,7 +47,7 @@ inline void Log(std::string_view format, Args&&... args) {
if constexpr(level == Error) prefix = "\e[35m[E]";
if constexpr(level == Fatal) prefix = "\e[31m[F]";

nba::print("{} {}\n", prefix, fmt::format(format, std::forward<Args>(args)...));
fmt::print("{} {}\n", prefix, fmt::format(format, std::forward<Args>(args)...));
}
}

Expand Down
26 changes: 0 additions & 26 deletions src/nba/include/nba/print.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/nba/src/bus/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void Bus::Hardware::WriteHalf(u32 address, u16 value) {

case MGBA_LOG_SEND: {
if(mgba_log.enable && (value & 0x100) != 0) {
nba::print("mGBA log: {}\n", mgba_log.message.data());
fmt::print("mGBA log: {}\n", mgba_log.message.data());
std::fflush(stdout);
mgba_log.message.fill(0);
}
Expand Down

0 comments on commit 0b5a2f7

Please sign in to comment.