diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 56f995e45e..3feef35b77 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -904,7 +904,8 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), #pragma warning(disable: 4125) #endif -#if PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII +#if defined(PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII) && \ + PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII #define PROTOBUF_DEBUG true #else #define PROTOBUF_DEBUG false