From ef1c9fd9077440acacf4fec112153dda4a2c9d44 Mon Sep 17 00:00:00 2001 From: Rose <91555155+rpvela@users.noreply.github.com> Date: Thu, 11 Nov 2021 00:37:03 +0000 Subject: [PATCH] [C++] Fix missing #ifdef for undefined identifiers (#9201) * Fix #if for undefined identifiers * port_undef.inc --- src/google/protobuf/inlined_string_field.h | 2 +- src/google/protobuf/port_def.inc | 4 ++-- src/google/protobuf/port_undef.inc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/google/protobuf/inlined_string_field.h b/src/google/protobuf/inlined_string_field.h index 1fe639f065..e4ab35972a 100644 --- a/src/google/protobuf/inlined_string_field.h +++ b/src/google/protobuf/inlined_string_field.h @@ -347,7 +347,7 @@ inline void InlinedStringField::Swap( InlinedStringField* from, const std::string* /*default_value*/, Arena* arena, bool donated, bool from_donated, uint32_t* donating_states, uint32_t* from_donating_states, uint32_t mask) { -#if GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE +#ifdef GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE // If one is donated and the other is not, undonate the donated one. if (donated && !from_donated) { MutableSlow(arena, donated, donating_states, mask); diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 71325c3872..67b67e949e 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -617,7 +617,7 @@ #ifdef PROTOBUF_PRAGMA_INIT_SEG #error PROTOBUF_PRAGMA_INIT_SEG was previously defined #endif -#if _MSC_VER +#ifdef _MSC_VER #define PROTOBUF_PRAGMA_INIT_SEG __pragma(init_seg(lib)) #else #define PROTOBUF_PRAGMA_INIT_SEG @@ -784,7 +784,7 @@ #endif // Silence some MSVC warnings in all our code. -#if _MSC_VER +#ifdef _MSC_VER #pragma warning(push) // For non-trivial unions #pragma warning(disable : 4582) diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc index 579eb419d0..ccc5daf564 100644 --- a/src/google/protobuf/port_undef.inc +++ b/src/google/protobuf/port_undef.inc @@ -140,6 +140,6 @@ #endif // Pop the warning(push) from port_def.inc -#if _MSC_VER +#ifdef _MSC_VER #pragma warning(pop) #endif