diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index 6577a3669217a..ce9d7882a9b48 100644 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -519,7 +519,7 @@ ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() { new internal::ThreadLocalStorage(); return *thread_cache_->Get(); } -#elif defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER) +#elif defined(PROTOBUF_USE_DLLS) && defined(_WIN32) ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() { static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache; return thread_cache; diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h index f39ddf696b32d..1bd40c8aff64e 100644 --- a/src/google/protobuf/descriptor.h +++ b/src/google/protobuf/descriptor.h @@ -444,7 +444,7 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { // A range of field numbers which are designated for third-party // extensions. - class ExtensionRange { + class PROTOBUF_EXPORT ExtensionRange { public: typedef DescriptorProto_ExtensionRange Proto; diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 6fe1fcb065698..c1696ef9584db 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -706,7 +706,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), // constant-initializing weak default instance pointers. Versions 12.0 and // higher seem to work, except that XCode 12.5.1 shows the error even though it // uses Clang 12.0.5. -# elif !defined(__CYGWIN__) && \ +# elif !defined(__CYGWIN__) && !defined(__MINGW32__) && \ __has_cpp_attribute(clang::require_constant_initialization) && \ ((defined(__APPLE__) && PROTOBUF_CLANG_MIN(13, 0)) || \ (!defined(__APPLE__) && PROTOBUF_CLANG_MIN(12, 0))) diff --git a/src/google/protobuf/reflection_mode.cc b/src/google/protobuf/reflection_mode.cc index 2f6eec286eabe..57b325643a7ee 100644 --- a/src/google/protobuf/reflection_mode.cc +++ b/src/google/protobuf/reflection_mode.cc @@ -39,7 +39,7 @@ namespace internal { #if !defined(PROTOBUF_NO_THREADLOCAL) -#if defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER) +#if defined(PROTOBUF_USE_DLLS) && defined(_WIN32) ReflectionMode& ScopedReflectionMode::reflection_mode() { static PROTOBUF_THREAD_LOCAL ReflectionMode reflection_mode = ReflectionMode::kDefault; diff --git a/src/google/protobuf/reflection_mode.h b/src/google/protobuf/reflection_mode.h index 5e1f237a3500c..df28ed78ec082 100644 --- a/src/google/protobuf/reflection_mode.h +++ b/src/google/protobuf/reflection_mode.h @@ -95,7 +95,7 @@ class PROTOBUF_EXPORT ScopedReflectionMode final { private: #if !defined(PROTOBUF_NO_THREADLOCAL) const ReflectionMode previous_mode_; -#if defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER) +#if defined(PROTOBUF_USE_DLLS) && defined(_WIN32) // Thread local variables cannot be exposed through MSVC DLL interface but we // can wrap them in static functions. static ReflectionMode& reflection_mode(); @@ -108,7 +108,7 @@ class PROTOBUF_EXPORT ScopedReflectionMode final { #if !defined(PROTOBUF_NO_THREADLOCAL) -#if defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER) +#if defined(PROTOBUF_USE_DLLS) && defined(_WIN32) inline ScopedReflectionMode::ScopedReflectionMode(ReflectionMode mode) : previous_mode_(reflection_mode()) { diff --git a/src/google/protobuf/thread_safe_arena.h b/src/google/protobuf/thread_safe_arena.h index f53993a852867..d4cf99fe041cd 100644 --- a/src/google/protobuf/thread_safe_arena.h +++ b/src/google/protobuf/thread_safe_arena.h @@ -260,7 +260,7 @@ class PROTOBUF_EXPORT ThreadSafeArena { // iOS does not support __thread keyword so we use a custom thread local // storage class we implemented. static ThreadCache& thread_cache(); -#elif defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER) +#elif defined(PROTOBUF_USE_DLLS) && defined(_WIN32) // Thread local variables cannot be exposed through MSVC DLL interface but we // can wrap them in static functions. static ThreadCache& thread_cache();