diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index c838c225c051..d09877ba0bd2 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -382,6 +382,8 @@ // Windows declares several inconvenient macro names. We #undef them and then // restore them in port_undef.inc. #ifdef _MSC_VER +#pragma push_macro("ERROR") +#undef ERROR #pragma push_macro("GetMessage") #undef GetMessage #pragma push_macro("IGNORE") diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc index 3b80e52172c8..2cc56f37347c 100644 --- a/src/google/protobuf/port_undef.inc +++ b/src/google/protobuf/port_undef.inc @@ -72,6 +72,7 @@ // Restore macro that may have been #undef'd in port_def.inc. #ifdef _MSC_VER +#pragma pop_macro("ERROR") #pragma pop_macro("GetMessage") #pragma pop_macro("IGNORE") #pragma pop_macro("IN")