diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2015-06-08 16:24:57 -0400 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2015-06-08 17:17:22 -0400 |
commit | d846b0b059b4d867536b98aa29475a387aa09114 (patch) | |
tree | 25ebf99cd0462281add17fc94bdf185e5fd9096c /objectivec/google/protobuf/Empty.pbobjc.m | |
parent | 3f9be70d067fb03cd03f99522473dee265b84ddb (diff) |
Beta quality drop of Objective C Support.
- Add more to the ObjC dir readme.
- Merge the ExtensionField and ExtensionDescriptor to reduce overhead.
- Fix an initialization race.
- Clean up the Xcode schemes.
- Remove the class/enum filter.
- Remove some forced inline that were bloating things without proof of performance wins.
- Rename some internal types to avoid conflicts with the well know types protos.
- Drop the use of ApplyFunctions to the compiler/optimizer can do what it wants.
- Better document some possible future improvements.
- Add missing support for parsing repeated primitive fields in packed or unpacked forms.
- Improve -hash.
- Add *Count for repeated and map<> fields to avoid auto create when checking for them being set.
Diffstat (limited to 'objectivec/google/protobuf/Empty.pbobjc.m')
-rw-r--r-- | objectivec/google/protobuf/Empty.pbobjc.m | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/objectivec/google/protobuf/Empty.pbobjc.m b/objectivec/google/protobuf/Empty.pbobjc.m index 619fe905..17f0c1ac 100644 --- a/objectivec/google/protobuf/Empty.pbobjc.m +++ b/objectivec/google/protobuf/Empty.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBEmptyRoot_FileDescriptor + static GPBFileDescriptor *GPBEmptyRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -27,30 +30,31 @@ static GPBFileDescriptor *GPBEmptyRoot_FileDescriptor(void) { @implementation GPBEmpty -typedef struct GPBEmpty_Storage { +typedef struct GPBEmpty__storage_ { uint32_t _has_storage_[0]; -} GPBEmpty_Storage; +} GPBEmpty__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEmpty class] - rootClass:[GPBEmptyRoot class] - file:GPBEmptyRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBEmpty_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEmpty class] + rootClass:[GPBEmptyRoot class] + file:GPBEmptyRoot_FileDescriptor() + fields:NULL + fieldCount:0 + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBEmpty__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } |