Workaround `TRUE` and `FALSE` macro definitions on WIN32

One of the [GCP proto files](https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto) defines `TRUE` and `FALSE` as enum values ([permalink](a4f2de4564/google/cloud/asset/v1/assets.proto (L782-L786))).  These cause trouble on WIN32, where `TRUE` and `FALSE` are also macro definitions.

For more details, see https://github.com/googleapis/google-cloud-cpp/issues/8145.

PiperOrigin-RevId: 507831036
pull/11839/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent 3cb89498e2
commit e349ef99c9
  1. 4
      src/google/protobuf/port_def.inc
  2. 2
      src/google/protobuf/port_undef.inc

@ -950,6 +950,10 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and
#undef STRICT
#pragma push_macro("timezone")
#undef timezone
#pragma push_macro("TRUE")
#undef TRUE
#pragma push_macro("FALSE")
#undef FALSE
#endif // _WIN32
#ifdef __APPLE__

@ -163,6 +163,8 @@
#pragma pop_macro("STRICT")
#pragma pop_macro("STATUS_PENDING")
#pragma pop_macro("timezone")
#pragma pop_macro("TRUE")
#pragma pop_macro("FALSE")
#endif
#ifdef __APPLE__

Loading…
Cancel
Save