diff --git a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc index 6b9a5eb1dbc0..cdcd9a6da225 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc @@ -496,7 +496,7 @@ void RepeatedEnumFieldGenerator::GenerateConstinitInitializer( format("$name$_()"); if (descriptor_->is_packed() && HasGeneratedMethods(descriptor_->file(), options_)) { - format("\n, _$name$_cached_byte_size_()"); + format("\n, _$name$_cached_byte_size_(0)"); } } diff --git a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc index 98ba8a698e65..9664586f2853 100644 --- a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc @@ -486,7 +486,7 @@ void RepeatedPrimitiveFieldGenerator::GenerateConstinitInitializer( format("$name$_()"); if (descriptor_->is_packed() && FixedSize(descriptor_->type()) == -1 && HasGeneratedMethods(descriptor_->file(), options_)) { - format("\n, _$name$_cached_byte_size_()"); + format("\n, _$name$_cached_byte_size_(0)"); } } diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 8aef94cbf65f..86df8966c539 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -393,9 +393,9 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT UninterpretedOptionDefaultTypeI constexpr SourceCodeInfo_Location::SourceCodeInfo_Location( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : path_() - , _path_cached_byte_size_() + , _path_cached_byte_size_(0) , span_() - , _span_cached_byte_size_() + , _span_cached_byte_size_(0) , leading_detached_comments_() , leading_comments_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , trailing_comments_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} @@ -423,7 +423,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SourceCodeInfoDefaultTypeIntern constexpr GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : path_() - , _path_cached_byte_size_() + , _path_cached_byte_size_(0) , source_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , begin_(0) , end_(0){} diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index b6c11d27a217..1cf006832a7b 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -136,8 +136,10 @@ #elif defined(__FreeBSD__) #include // __BYTE_ORDER #else +#if !defined(__QNX__) #include // __BYTE_ORDER #endif +#endif #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \ !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) diff --git a/src/google/protobuf/stubs/mutex.h b/src/google/protobuf/stubs/mutex.h index bff96814b441..79c9f6784894 100644 --- a/src/google/protobuf/stubs/mutex.h +++ b/src/google/protobuf/stubs/mutex.h @@ -116,7 +116,11 @@ class CallOnceInitializedMutex { // mutexes. class GOOGLE_PROTOBUF_CAPABILITY("mutex") PROTOBUF_EXPORT WrappedMutex { public: +#if defined(__QNX__) + constexpr WrappedMutex() = default; +#else constexpr WrappedMutex() {} +#endif void Lock() GOOGLE_PROTOBUF_ACQUIRE() { mu_.lock(); } void Unlock() GOOGLE_PROTOBUF_RELEASE() { mu_.unlock(); } // Crash if this Mutex is not held exclusively by this thread. diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h index ce1b1e365576..24799600dcf8 100644 --- a/src/google/protobuf/stubs/platform_macros.h +++ b/src/google/protobuf/stubs/platform_macros.h @@ -46,7 +46,11 @@ #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 #elif defined(__QNX__) #define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1 +#if defined(__aarch64__) +#define GOOGLE_PROTOBUF_ARCH_64_BIT 1 +#else #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 +#endif #elif defined(_M_ARM) || defined(__ARMEL__) #define GOOGLE_PROTOBUF_ARCH_ARM 1 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index bead0af74306..d4d2736c8579 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -62,8 +62,10 @@ #elif defined(__FreeBSD__) #include // __BYTE_ORDER #else +#if !defined(__QNX__) #include // __BYTE_ORDER #endif +#endif #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \ (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN)) && \