From 3f2ef7f523f9b4d440460789fba44a0e1fcfede1 Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 9 Oct 2025 23:33:47 -0400 Subject: [PATCH] fix: Undefine Windows macros to prevent conflicts with protobuf generated code - Added preprocessor directives to undefine the DWORD and ERROR macros on Windows, ensuring compatibility with protobuf generated code in imgui_test_harness_service.h and gui_automation_client.h. - This change prevents potential compilation issues when using gRPC and protobuf in a Windows environment. --- src/app/core/service/imgui_test_harness_service.h | 10 ++++++++++ src/cli/service/gui/gui_automation_client.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/app/core/service/imgui_test_harness_service.h b/src/app/core/service/imgui_test_harness_service.h index a278fa7e..0ad11db2 100644 --- a/src/app/core/service/imgui_test_harness_service.h +++ b/src/app/core/service/imgui_test_harness_service.h @@ -11,6 +11,16 @@ #include "app/core/service/widget_discovery_service.h" #include "app/core/testing/test_recorder.h" +// Undefine Windows macros that conflict with protobuf generated code +#ifdef _WIN32 +#ifdef DWORD +#undef DWORD +#endif +#ifdef ERROR +#undef ERROR +#endif +#endif // _WIN32 + // Include grpcpp headers for unique_ptr in member variable #include diff --git a/src/cli/service/gui/gui_automation_client.h b/src/cli/service/gui/gui_automation_client.h index 66a35296..fd985e5d 100644 --- a/src/cli/service/gui/gui_automation_client.h +++ b/src/cli/service/gui/gui_automation_client.h @@ -17,6 +17,15 @@ #include #ifdef YAZE_WITH_GRPC +// Undefine Windows macros that conflict with protobuf generated code +#ifdef _WIN32 +#ifdef DWORD +#undef DWORD +#endif +#ifdef ERROR +#undef ERROR +#endif +#endif // _WIN32 #include #include "protos/imgui_test_harness.grpc.pb.h" #endif