Commit 21800ff8 authored by Thomas Van Lenten's avatar Thomas Van Lenten

Add a objc_class_prefix to test_messages_proto3.proto.

Both test_messages_proto3.proto & test_messages_proto2.proto define
message ForeignMessage {...} and enum ForeignEnum {...} but since
objc doesn't use the proto package in the naming, these end up
conflicting.

Adding the objc_class_prefix option to the proto3 file ensure the generated
objc types are all unique.
parent 8d5f2c57
...@@ -63,7 +63,7 @@ static NSData *CheckedReadDataOfLength(NSFileHandle *handle, NSUInteger numBytes ...@@ -63,7 +63,7 @@ static NSData *CheckedReadDataOfLength(NSFileHandle *handle, NSUInteger numBytes
static ConformanceResponse *DoTest(ConformanceRequest *request) { static ConformanceResponse *DoTest(ConformanceRequest *request) {
ConformanceResponse *response = [ConformanceResponse message]; ConformanceResponse *response = [ConformanceResponse message];
TestAllTypesProto3 *testMessage = nil; Proto3TestAllTypesProto3 *testMessage = nil;
switch (request.payloadOneOfCase) { switch (request.payloadOneOfCase) {
case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase: case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase:
...@@ -73,7 +73,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { ...@@ -73,7 +73,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: {
if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypesProto3"]) { if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypesProto3"]) {
NSError *error = nil; NSError *error = nil;
testMessage = [TestAllTypesProto3 parseFromData:request.protobufPayload testMessage = [Proto3TestAllTypesProto3 parseFromData:request.protobufPayload
error:&error]; error:&error];
if (!testMessage) { if (!testMessage) {
response.parseError = response.parseError =
......
...@@ -39,6 +39,7 @@ syntax = "proto3"; ...@@ -39,6 +39,7 @@ syntax = "proto3";
package protobuf_test_messages.proto3; package protobuf_test_messages.proto3;
option java_package = "com.google.protobuf_test_messages.proto3"; option java_package = "com.google.protobuf_test_messages.proto3";
option objc_class_prefix = "Proto3";
// This is the default, but we specify it here explicitly. // This is the default, but we specify it here explicitly.
option optimize_for = SPEED; option optimize_for = SPEED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment