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:
@@ -5,7 +5,17 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma push_macro("DWORD")
|
||||||
|
#pragma push_macro("ERROR")
|
||||||
|
#undef DWORD
|
||||||
|
#undef ERROR
|
||||||
|
#endif // _WIN32
|
||||||
#include "protos/imgui_test_harness.pb.h"
|
#include "protos/imgui_test_harness.pb.h"
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma pop_macro("DWORD")
|
||||||
|
#pragma pop_macro("ERROR")
|
||||||
|
#endif // _WIN32
|
||||||
#include "app/gui/widgets/widget_id_registry.h"
|
#include "app/gui/widgets/widget_id_registry.h"
|
||||||
|
|
||||||
#if defined(YAZE_ENABLE_IMGUI_TEST_ENGINE) && YAZE_ENABLE_IMGUI_TEST_ENGINE
|
#if defined(YAZE_ENABLE_IMGUI_TEST_ENGINE) && YAZE_ENABLE_IMGUI_TEST_ENGINE
|
||||||
|
|||||||
@@ -8,8 +8,18 @@
|
|||||||
#include "absl/status/statusor.h"
|
#include "absl/status/statusor.h"
|
||||||
|
|
||||||
#ifdef YAZE_WITH_GRPC
|
#ifdef YAZE_WITH_GRPC
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma push_macro("DWORD")
|
||||||
|
#pragma push_macro("ERROR")
|
||||||
|
#undef DWORD
|
||||||
|
#undef ERROR
|
||||||
|
#endif // _WIN32
|
||||||
#include <grpcpp/grpcpp.h>
|
#include <grpcpp/grpcpp.h>
|
||||||
#include "protos/rom_service.grpc.pb.h"
|
#include "protos/rom_service.grpc.pb.h"
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma pop_macro("DWORD")
|
||||||
|
#pragma pop_macro("ERROR")
|
||||||
|
#endif // _WIN32
|
||||||
// Note: Proto files will be generated to build directory
|
// Note: Proto files will be generated to build directory
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,20 @@
|
|||||||
#ifdef YAZE_WITH_GRPC
|
#ifdef YAZE_WITH_GRPC
|
||||||
// Undefine Windows macros that conflict with protobuf generated code
|
// Undefine Windows macros that conflict with protobuf generated code
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifdef DWORD
|
#pragma push_macro("DWORD")
|
||||||
|
#pragma push_macro("ERROR")
|
||||||
#undef DWORD
|
#undef DWORD
|
||||||
#endif
|
|
||||||
#ifdef ERROR
|
|
||||||
#undef ERROR
|
#undef ERROR
|
||||||
#endif
|
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <grpcpp/grpcpp.h>
|
#include <grpcpp/grpcpp.h>
|
||||||
#include "protos/imgui_test_harness.grpc.pb.h"
|
#include "protos/imgui_test_harness.grpc.pb.h"
|
||||||
|
|
||||||
|
// Restore Windows macros
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma pop_macro("DWORD")
|
||||||
|
#pragma pop_macro("ERROR")
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
|
|||||||
Reference in New Issue
Block a user