From 670e014065b0b8962e9034c35b284d730231f951 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 28 Feb 2024 14:31:30 -0800 Subject: [PATCH] Workaround `SERVICE_STOP` macro definition on WIN32. One of the [GCP proto files](https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/mitre_attack.proto#L186) recently introduce a message enum field named `SERVICE_STOP`. Unfortunately this clashes with a macro from `winsvc.h`, so add `SERVICE_STOP` to the push/undef/pop wrappers. PiperOrigin-RevId: 611231375 --- src/google/protobuf/port_def.inc | 2 ++ src/google/protobuf/port_undef.inc | 1 + 2 files changed, 3 insertions(+) diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 136787f0c4..8931901227 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -825,6 +825,8 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), #undef REASON_UNKNOWN #pragma push_macro("SERVICE_DISABLED") #undef SERVICE_DISABLED +#pragma push_macro("SERVICE_STOP") +#undef SERVICE_STOP #pragma push_macro("SEVERITY_ERROR") #undef SEVERITY_ERROR #pragma push_macro("STATUS_PENDING") diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc index e81b42e052..b2d0848873 100644 --- a/src/google/protobuf/port_undef.inc +++ b/src/google/protobuf/port_undef.inc @@ -136,6 +136,7 @@ #pragma pop_macro("NO_ERROR") #pragma pop_macro("REASON_UNKNOWN") #pragma pop_macro("SERVICE_DISABLED") +#pragma pop_macro("SERVICE_STOP") #pragma pop_macro("SEVERITY_ERROR") #pragma pop_macro("STRICT") #pragma pop_macro("STATUS_PENDING")