Merge pull request #8637 from dschopf/fix-qnx-7.0-support

Fix QNX 7.0 support #8593
pull/8698/head^2
Matt Fowles Kulukundis 4 years ago committed by GitHub
commit 8d8ba6acc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/google/protobuf/compiler/cpp/cpp_enum_field.cc
  2. 2
      src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
  3. 6
      src/google/protobuf/descriptor.pb.cc
  4. 2
      src/google/protobuf/io/coded_stream.h
  5. 4
      src/google/protobuf/stubs/mutex.h
  6. 4
      src/google/protobuf/stubs/platform_macros.h
  7. 2
      src/google/protobuf/stubs/port.h

@ -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)");
}
}

@ -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)");
}
}

@ -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){}

@ -136,8 +136,10 @@
#elif defined(__FreeBSD__)
#include <sys/endian.h> // __BYTE_ORDER
#else
#if !defined(__QNX__)
#include <endian.h> // __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)

@ -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.

@ -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

@ -62,8 +62,10 @@
#elif defined(__FreeBSD__)
#include <sys/endian.h> // __BYTE_ORDER
#else
#if !defined(__QNX__)
#include <endian.h> // __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)) && \

Loading…
Cancel
Save