fix: Restore Windows macro definitions to prevent conflicts with protobuf generated code

- Added preprocessor directives to push and pop the DWORD and ERROR macros in widget_discovery_service.h, rom_service_impl.h, and gui_automation_client.h.
- This change ensures compatibility with protobuf generated code in a Windows environment, preventing potential compilation issues.
This commit is contained in:
scawful
2025-10-10 08:44:01 -04:00
parent 78b7d38359
commit 6c6bb67a87
3 changed files with 29 additions and 4 deletions

View File

@@ -19,15 +19,20 @@
#ifdef YAZE_WITH_GRPC
// Undefine Windows macros that conflict with protobuf generated code
#ifdef _WIN32
#ifdef DWORD
#pragma push_macro("DWORD")
#pragma push_macro("ERROR")
#undef DWORD
#endif
#ifdef ERROR
#undef ERROR
#endif
#endif // _WIN32
#include <grpcpp/grpcpp.h>
#include "protos/imgui_test_harness.grpc.pb.h"
// Restore Windows macros
#ifdef _WIN32
#pragma pop_macro("DWORD")
#pragma pop_macro("ERROR")
#endif
#endif
namespace yaze {