[ObjC] Generation changes around proto3 optional.
- Bump the version marker in the generated code.
- Set the flag to say clear on zero is known.
- Set clear on zero for proto3 optional fields that aren't tagged as optional.
- Also tweak the call from some C generated code to use different apis with
better validation.
- Mark the ObjC generator as supporting the proto3 optional feature.
- Regenerate the WKTs to get the new flags.
diff --git a/objectivec/GPBSourceContext.pbobjc.m b/objectivec/GPBSourceContext.pbobjc.m
index d37a425..b3e6fa7 100644
--- a/objectivec/GPBSourceContext.pbobjc.m
+++ b/objectivec/GPBSourceContext.pbobjc.m
@@ -70,7 +70,7 @@
.number = GPBSourceContext_FieldNumber_FileName,
.hasIndex = 0,
.offset = (uint32_t)offsetof(GPBSourceContext__storage_, fileName),
- .flags = GPBFieldOptional,
+ .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
.dataType = GPBDataTypeString,
},
};
@@ -81,7 +81,7 @@
fields:fields
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
storageSize:sizeof(GPBSourceContext__storage_)
- flags:GPBDescriptorInitializationFlag_UsesClassRefs];
+ flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
#if defined(DEBUG) && DEBUG
NSAssert(descriptor == nil, @"Startup recursed!");
#endif // DEBUG