aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/google/protobuf/Duration.pbobjc.m
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2015-06-08 16:24:57 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2015-06-08 17:17:22 -0400
commitd846b0b059b4d867536b98aa29475a387aa09114 (patch)
tree25ebf99cd0462281add17fc94bdf185e5fd9096c /objectivec/google/protobuf/Duration.pbobjc.m
parent3f9be70d067fb03cd03f99522473dee265b84ddb (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/Duration.pbobjc.m')
-rw-r--r--objectivec/google/protobuf/Duration.pbobjc.m50
1 files changed, 28 insertions, 22 deletions
diff --git a/objectivec/google/protobuf/Duration.pbobjc.m b/objectivec/google/protobuf/Duration.pbobjc.m
index 4db030f4..e4fd4951 100644
--- a/objectivec/google/protobuf/Duration.pbobjc.m
+++ b/objectivec/google/protobuf/Duration.pbobjc.m
@@ -11,11 +11,14 @@
@end
+#pragma mark - GPBDurationRoot_FileDescriptor
+
static GPBFileDescriptor *GPBDurationRoot_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];
}
@@ -29,16 +32,16 @@ static GPBFileDescriptor *GPBDurationRoot_FileDescriptor(void) {
@dynamic seconds;
@dynamic nanos;
-typedef struct GPBDuration_Storage {
+typedef struct GPBDuration__storage_ {
uint32_t _has_storage_[1];
int32_t nanos;
int64_t seconds;
-} GPBDuration_Storage;
+} GPBDuration__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[] = {
{
@@ -46,10 +49,10 @@ typedef struct GPBDuration_Storage {
.number = GPBDuration_FieldNumber_Seconds,
.hasIndex = 0,
.flags = GPBFieldOptional,
- .type = GPBTypeInt64,
- .offset = offsetof(GPBDuration_Storage, seconds),
+ .dataType = GPBDataTypeInt64,
+ .offset = offsetof(GPBDuration__storage_, seconds),
.defaultValue.valueInt64 = 0LL,
- .typeSpecific.className = NULL,
+ .dataTypeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
@@ -57,26 +60,29 @@ typedef struct GPBDuration_Storage {
.number = GPBDuration_FieldNumber_Nanos,
.hasIndex = 1,
.flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(GPBDuration_Storage, nanos),
+ .dataType = GPBDataTypeInt32,
+ .offset = offsetof(GPBDuration__storage_, nanos),
.defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
+ .dataTypeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
- descriptor = [GPBDescriptor allocDescriptorForClass:[GPBDuration class]
- rootClass:[GPBDurationRoot class]
- file:GPBDurationRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(GPBDuration_Storage)
- wireFormat:NO];
+ GPBDescriptor *localDescriptor =
+ [GPBDescriptor allocDescriptorForClass:[GPBDuration class]
+ rootClass:[GPBDurationRoot class]
+ file:GPBDurationRoot_FileDescriptor()
+ fields:fields
+ fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
+ oneofs:NULL
+ oneofCount:0
+ enums:NULL
+ enumCount:0
+ ranges:NULL
+ rangeCount:0
+ storageSize:sizeof(GPBDuration__storage_)
+ wireFormat:NO];
+ NSAssert(descriptor == nil, @"Startup recursed!");
+ descriptor = localDescriptor;
}
return descriptor;
}