Index: third_party/protobuf/objectivec/GPBDescriptor_PackagePrivate.h |
diff --git a/third_party/protobuf/objectivec/GPBDescriptor_PackagePrivate.h b/third_party/protobuf/objectivec/GPBDescriptor_PackagePrivate.h |
index e3d0a80f0525bea9d3b9d4869ece58cf7547d362..9173e7a2b10a4cdd11317a8e45a1fdb66550e21d 100644 |
--- a/third_party/protobuf/objectivec/GPBDescriptor_PackagePrivate.h |
+++ b/third_party/protobuf/objectivec/GPBDescriptor_PackagePrivate.h |
@@ -37,6 +37,7 @@ |
// Describes attributes of the field. |
typedef NS_OPTIONS(uint16_t, GPBFieldFlags) { |
+ GPBFieldNone = 0, |
// These map to standard protobuf concepts. |
GPBFieldRequired = 1 << 0, |
GPBFieldRepeated = 1 << 1, |
@@ -111,6 +112,7 @@ typedef struct GPBMessageFieldDescriptionWithDefault { |
// Describes attributes of the extension. |
typedef NS_OPTIONS(uint8_t, GPBExtensionOptions) { |
+ GPBExtensionNone = 0, |
// These map to standard protobuf concepts. |
GPBExtensionRepeated = 1 << 0, |
GPBExtensionPacked = 1 << 1, |
@@ -130,6 +132,7 @@ typedef struct GPBExtensionDescription { |
} GPBExtensionDescription; |
typedef NS_OPTIONS(uint32_t, GPBDescriptorInitializationFlags) { |
+ GPBDescriptorInitializationFlag_None = 0, |
GPBDescriptorInitializationFlag_FieldsWithDefault = 1 << 0, |
GPBDescriptorInitializationFlag_WireFormat = 1 << 1, |
}; |
@@ -165,11 +168,16 @@ typedef NS_OPTIONS(uint32_t, GPBDescriptorInitializationFlags) { |
firstHasIndex:(int32_t)firstHasIndex; |
- (void)setupExtraTextInfo:(const char *)extraTextFormatInfo; |
- (void)setupExtensionRanges:(const GPBExtensionRange *)ranges count:(int32_t)count; |
+- (void)setupContainingMessageClassName:(const char *)msgClassName; |
+- (void)setupMessageClassNameSuffix:(NSString *)suffix; |
@end |
@interface GPBFileDescriptor () |
- (instancetype)initWithPackage:(NSString *)package |
+ objcPrefix:(NSString *)objcPrefix |
+ syntax:(GPBFileSyntax)syntax; |
+- (instancetype)initWithPackage:(NSString *)package |
syntax:(GPBFileSyntax)syntax; |
@end |
@@ -245,6 +253,12 @@ typedef NS_OPTIONS(uint32_t, GPBDescriptorInitializationFlags) { |
CF_EXTERN_C_BEGIN |
+// Direct access is use for speed, to avoid even internally declaring things |
+// read/write, etc. The warning is enabled in the project to ensure code calling |
+// protos can turn on -Wdirect-ivar-access without issues. |
+#pragma clang diagnostic push |
+#pragma clang diagnostic ignored "-Wdirect-ivar-access" |
+ |
GPB_INLINE BOOL GPBFieldIsMapOrArray(GPBFieldDescriptor *field) { |
return (field->description_->flags & |
(GPBFieldRepeated | GPBFieldMapKeyMask)) != 0; |
@@ -262,6 +276,8 @@ GPB_INLINE uint32_t GPBFieldNumber(GPBFieldDescriptor *field) { |
return field->description_->number; |
} |
+#pragma clang diagnostic pop |
+ |
uint32_t GPBFieldTag(GPBFieldDescriptor *self); |
// For repeated fields, alternateWireType is the wireType with the opposite |
@@ -291,23 +307,23 @@ GPB_INLINE BOOL GPBExtensionIsWireFormat(GPBExtensionDescription *description) { |
} |
// Helper for compile time assets. |
-#ifndef _GPBCompileAssert |
+#ifndef GPBInternalCompileAssert |
#if __has_feature(c_static_assert) || __has_extension(c_static_assert) |
- #define _GPBCompileAssert(test, msg) _Static_assert((test), #msg) |
+ #define GPBInternalCompileAssert(test, msg) _Static_assert((test), #msg) |
#else |
// Pre-Xcode 7 support. |
- #define _GPBCompileAssertSymbolInner(line, msg) _GPBCompileAssert ## line ## __ ## msg |
- #define _GPBCompileAssertSymbol(line, msg) _GPBCompileAssertSymbolInner(line, msg) |
- #define _GPBCompileAssert(test, msg) \ |
- typedef char _GPBCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] |
+ #define GPBInternalCompileAssertSymbolInner(line, msg) GPBInternalCompileAssert ## line ## __ ## msg |
+ #define GPBInternalCompileAssertSymbol(line, msg) GPBInternalCompileAssertSymbolInner(line, msg) |
+ #define GPBInternalCompileAssert(test, msg) \ |
+ typedef char GPBInternalCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] |
#endif // __has_feature(c_static_assert) || __has_extension(c_static_assert) |
-#endif // _GPBCompileAssert |
+#endif // GPBInternalCompileAssert |
// Sanity check that there isn't padding between the field description |
// structures with and without a default. |
-_GPBCompileAssert(sizeof(GPBMessageFieldDescriptionWithDefault) == |
- (sizeof(GPBGenericValue) + |
- sizeof(GPBMessageFieldDescription)), |
- DescriptionsWithDefault_different_size_than_expected); |
+GPBInternalCompileAssert(sizeof(GPBMessageFieldDescriptionWithDefault) == |
+ (sizeof(GPBGenericValue) + |
+ sizeof(GPBMessageFieldDescription)), |
+ DescriptionsWithDefault_different_size_than_expected); |
CF_EXTERN_C_END |