Skip to content

Commit 450f06f

Browse files
committed
Fix Windows ERROR macro leakage from startup trace headers
1 parent a691646 commit 450f06f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/gui/main_gui.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#define NOMINMAX
2929
#endif
3030
#include <windows.h>
31+
#ifdef ERROR
32+
#undef ERROR
33+
#endif
3134
#endif
3235

3336
namespace {

src/gui/startup_trace.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#define NOMINMAX
1111
#endif
1212
#include <windows.h>
13+
// Prevent Windows ERROR macro from corrupting LOG_* macros in translation units
14+
#ifdef ERROR
15+
#undef ERROR
16+
#endif
1317
#endif
1418

1519
namespace ultra {

0 commit comments

Comments
 (0)