diff options
Diffstat (limited to 'objectivec')
26 files changed, 285 insertions, 60 deletions
diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh index b382779e..ff51d9f0 100755 --- a/objectivec/DevTools/full_mac_build.sh +++ b/objectivec/DevTools/full_mac_build.sh @@ -26,8 +26,9 @@ OPTIONS: Issue a clean before the normal build. -a, --autogen Start by rerunning autogen & configure. - -r, --regenerate-cpp-descriptors - The descriptor.proto is checked in generated, cause it to regenerate. + -r, --regenerate-descriptors + Run generate_descriptor_proto.sh to regenerate all the checked in + proto sources. -j #, --jobs # Force the number of parallel jobs (useful for debugging build issues). --core-only @@ -71,7 +72,7 @@ fi DO_AUTOGEN=no DO_CLEAN=no -REGEN_CPP_DESCRIPTORS=no +REGEN_DESCRIPTORS=no CORE_ONLY=no DO_XCODE_IOS_TESTS=yes DO_XCODE_OSX_TESTS=yes @@ -88,8 +89,8 @@ while [[ $# != 0 ]]; do -a | --autogen ) DO_AUTOGEN=yes ;; - -r | --regenerate-cpp-descriptors ) - REGEN_CPP_DESCRIPTORS=yes + -r | --regenerate-descriptors ) + REGEN_DESCRIPTORS=yes ;; -j | --jobs ) shift @@ -164,8 +165,8 @@ if [[ "${DO_CLEAN}" == "yes" ]] ; then fi fi -if [[ "${REGEN_CPP_DESCRIPTORS}" == "yes" ]] ; then - header "Regenerating the C++ descriptor sources." +if [[ "${REGEN_DESCRIPTORS}" == "yes" ]] ; then + header "Regenerating the descriptor sources." ./generate_descriptor_proto.sh -j "${NUM_MAKE_JOBS}" fi @@ -184,29 +185,8 @@ else cd .. fi -header "Ensuring the ObjC descriptors are current." -# Find the newest input file (protos, compiler, and the generator script). -# (these patterns catch some extra stuff, but better to over sample than under) -readonly NewestInput=$(find \ - src/google/protobuf/*.proto \ - src/.libs src/*.la src/protoc \ - objectivec/generate_well_known_types.sh \ - -type f -print0 \ - | xargs -0 stat -f "%m %N" \ - | sort -n | tail -n1 | cut -f2- -d" ") -# Find the oldest output file. -readonly OldestOutput=$(find \ - "${ProtoRootDir}/objectivec/google" \ - -type f -print0 \ - | xargs -0 stat -f "%m %N" \ - | sort -n -r | tail -n1 | cut -f2- -d" ") -# If the newest input is newer than the oldest output, regenerate. -if [[ "${NewestInput}" -nt "${OldestOutput}" ]] ; then - echo ">> Newest input is newer than oldest output, regenerating." - objectivec/generate_well_known_types.sh -j "${NUM_MAKE_JOBS}" -else - echo ">> Newest input is older than oldest output, no need to regenerating." -fi +# Ensure the WKT sources checked in are current. +objectivec/generate_well_known_types.sh --check-only -j "${NUM_MAKE_JOBS}" header "Checking on the ObjC Runtime Code" objectivec/DevTools/pddm_tests.py @@ -242,6 +222,14 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then -destination "platform=iOS Simulator,name=iPad Air,OS=9.0" # 64bit ) ;; + 7.3* ) + XCODEBUILD_TEST_BASE_IOS+=( + -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit + -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" # 64bit + -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit + -destination "platform=iOS Simulator,name=iPad Air,OS=9.3" # 64bit + ) + ;; 7.* ) XCODEBUILD_TEST_BASE_IOS+=( -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit diff --git a/objectivec/GPBCodedInputStream.h b/objectivec/GPBCodedInputStream.h index 06198883..d64b64e3 100644 --- a/objectivec/GPBCodedInputStream.h +++ b/objectivec/GPBCodedInputStream.h @@ -109,6 +109,15 @@ NS_ASSUME_NONNULL_BEGIN /// or until an endgroup tag, whichever comes first. - (void)skipMessage; +/// Check to see if the logical end of the stream has been reached. +/// +/// This can return NO when there is no more data, but the current parsing +/// expected more data. +- (BOOL)isAtEnd; + +/// The offset into the stream. +- (size_t)position; + /// Verifies that the last call to @c -readTag returned the given tag value. /// This is used to verify that a nested group ended with the correct end tag. /// Throws @c NSParseErrorException if value does not match the last tag. diff --git a/objectivec/GPBCodedInputStream.m b/objectivec/GPBCodedInputStream.m index fd877838..319ec15b 100644 --- a/objectivec/GPBCodedInputStream.m +++ b/objectivec/GPBCodedInputStream.m @@ -219,15 +219,16 @@ NSString *GPBCodedInputStreamReadRetainedString( result = [[NSString alloc] initWithBytes:&state->bytes[state->bufferPos] length:size encoding:NSUTF8StringEncoding]; + state->bufferPos += size; if (!result) { - result = @""; #ifdef DEBUG // https://developers.google.com/protocol-buffers/docs/proto#scalar - NSLog(@"UTF8 failure, is some field type 'string' when it should be " + NSLog(@"UTF-8 failure, is some field type 'string' when it should be " @"'bytes'?"); #endif + [NSException raise:NSParseErrorException + format:@"Invalid UTF-8 for a 'string'"]; } - state->bufferPos += size; } return result; } @@ -359,6 +360,14 @@ void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state, } } +- (BOOL)isAtEnd { + return GPBCodedInputStreamIsAtEnd(&state_); +} + +- (size_t)position { + return state_.bufferPos; +} + - (double)readDouble { return GPBCodedInputStreamReadDouble(&state_); } diff --git a/objectivec/GPBCodedOutputStream.h b/objectivec/GPBCodedOutputStream.h index e67efd2d..8272880d 100644 --- a/objectivec/GPBCodedOutputStream.h +++ b/objectivec/GPBCodedOutputStream.h @@ -112,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a double for the given field number. - (void)writeDouble:(int32_t)fieldNumber value:(double)value; -/// Write a packaged array of double for the given field number. +/// Write a packed array of double for the given field number. - (void)writeDoubleArray:(int32_t)fieldNumber values:(GPBDoubleArray *)values tag:(uint32_t)tag; @@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a float for the given field number. - (void)writeFloat:(int32_t)fieldNumber value:(float)value; -/// Write a packaged array of float for the given field number. +/// Write a packed array of float for the given field number. - (void)writeFloatArray:(int32_t)fieldNumber values:(GPBFloatArray *)values tag:(uint32_t)tag; @@ -130,7 +130,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a uint64_t for the given field number. - (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value; -/// Write a packaged array of uint64_t for the given field number. +/// Write a packed array of uint64_t for the given field number. - (void)writeUInt64Array:(int32_t)fieldNumber values:(GPBUInt64Array *)values tag:(uint32_t)tag; @@ -139,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a int64_t for the given field number. - (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value; -/// Write a packaged array of int64_t for the given field number. +/// Write a packed array of int64_t for the given field number. - (void)writeInt64Array:(int32_t)fieldNumber values:(GPBInt64Array *)values tag:(uint32_t)tag; @@ -148,7 +148,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a int32_t for the given field number. - (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value; -/// Write a packaged array of int32_t for the given field number. +/// Write a packed array of int32_t for the given field number. - (void)writeInt32Array:(int32_t)fieldNumber values:(GPBInt32Array *)values tag:(uint32_t)tag; @@ -157,7 +157,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a uint32_t for the given field number. - (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value; -/// Write a packaged array of uint32_t for the given field number. +/// Write a packed array of uint32_t for the given field number. - (void)writeUInt32Array:(int32_t)fieldNumber values:(GPBUInt32Array *)values tag:(uint32_t)tag; @@ -166,7 +166,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a uint64_t for the given field number. - (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value; -/// Write a packaged array of uint64_t for the given field number. +/// Write a packed array of uint64_t for the given field number. - (void)writeFixed64Array:(int32_t)fieldNumber values:(GPBUInt64Array *)values tag:(uint32_t)tag; @@ -175,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a uint32_t for the given field number. - (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value; -/// Write a packaged array of uint32_t for the given field number. +/// Write a packed array of uint32_t for the given field number. - (void)writeFixed32Array:(int32_t)fieldNumber values:(GPBUInt32Array *)values tag:(uint32_t)tag; @@ -184,7 +184,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a int32_t for the given field number. - (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value; -/// Write a packaged array of int32_t for the given field number. +/// Write a packed array of int32_t for the given field number. - (void)writeSInt32Array:(int32_t)fieldNumber values:(GPBInt32Array *)values tag:(uint32_t)tag; @@ -193,7 +193,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a int64_t for the given field number. - (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value; -/// Write a packaged array of int64_t for the given field number. +/// Write a packed array of int64_t for the given field number. - (void)writeSInt64Array:(int32_t)fieldNumber values:(GPBInt64Array *)values tag:(uint32_t)tag; @@ -202,7 +202,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a int64_t for the given field number. - (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value; -/// Write a packaged array of int64_t for the given field number. +/// Write a packed array of int64_t for the given field number. - (void)writeSFixed64Array:(int32_t)fieldNumber values:(GPBInt64Array *)values tag:(uint32_t)tag; @@ -211,7 +211,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a int32_t for the given field number. - (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value; -/// Write a packaged array of int32_t for the given field number. +/// Write a packed array of int32_t for the given field number. - (void)writeSFixed32Array:(int32_t)fieldNumber values:(GPBInt32Array *)values tag:(uint32_t)tag; @@ -220,7 +220,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a BOOL for the given field number. - (void)writeBool:(int32_t)fieldNumber value:(BOOL)value; -/// Write a packaged array of BOOL for the given field number. +/// Write a packed array of BOOL for the given field number. - (void)writeBoolArray:(int32_t)fieldNumber values:(GPBBoolArray *)values tag:(uint32_t)tag; @@ -229,7 +229,7 @@ NS_ASSUME_NONNULL_BEGIN /// Write a int32_t for the given field number. - (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value; -/// Write a packaged array of int32_t for the given field number. +/// Write a packed array of int32_t for the given field number. - (void)writeEnumArray:(int32_t)fieldNumber values:(GPBEnumArray *)values tag:(uint32_t)tag; @@ -293,7 +293,7 @@ NS_ASSUME_NONNULL_END //%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE) //%/// Write a TYPE for the given field number. //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value; -//%/// Write a packaged array of TYPE for the given field number. +//%/// Write a packed array of TYPE for the given field number. //%- (void)write##NAME##Array:(int32_t)fieldNumber //% NAME$S values:(GPB##ARRAY_TYPE##Array *)values //% NAME$S tag:(uint32_t)tag; diff --git a/objectivec/Tests/GPBCodedInputStreamTests.m b/objectivec/Tests/GPBCodedInputStreamTests.m index b0e39d2c..cc402156 100644 --- a/objectivec/Tests/GPBCodedInputStreamTests.m +++ b/objectivec/Tests/GPBCodedInputStreamTests.m @@ -283,16 +283,53 @@ [output writeRawData:[NSData dataWithBytes:bytes length:sizeof(bytes)]]; [output flush]; - NSData* data = + NSData *data = [rawOutput propertyForKey:NSStreamDataWrittenToMemoryStreamKey]; GPBCodedInputStream* input = [GPBCodedInputStream streamWithData:data]; + NSError *error = nil; TestAllTypes* message = [TestAllTypes parseFromCodedInputStream:input extensionRegistry:nil - error:NULL]; - XCTAssertNotNil(message); - // Make sure we can read string properties twice without crashing. - XCTAssertEqual([message.defaultString length], (NSUInteger)0); - XCTAssertEqualObjects(@"", message.defaultString); + error:&error]; + XCTAssertNotNil(error); + XCTAssertNil(message); +} + +- (void)testBOMWithinStrings { + // We've seen servers that end up with BOMs within strings (not always at the + // start, and sometimes in multiple places), make sure they always parse + // correctly. (Again, this is inpart incase a custom string class is ever + // used again.) + const char* strs[] = { + "\xEF\xBB\xBF String with BOM", + "String with \xEF\xBB\xBF in middle", + "String with end bom \xEF\xBB\xBF", + "\xEF\xBB\xBF\xe2\x99\xa1", // BOM White Heart + "\xEF\xBB\xBF\xEF\xBB\xBF String with Two BOM", + }; + for (size_t i = 0; i < GPBARRAYSIZE(strs); ++i) { + NSOutputStream* rawOutput = [NSOutputStream outputStreamToMemory]; + GPBCodedOutputStream* output = + [GPBCodedOutputStream streamWithOutputStream:rawOutput]; + + int32_t tag = GPBWireFormatMakeTag(TestAllTypes_FieldNumber_DefaultString, + GPBWireFormatLengthDelimited); + [output writeRawVarint32:tag]; + size_t length = strlen(strs[i]); + [output writeRawVarint32:(int32_t)length]; + [output writeRawData:[NSData dataWithBytes:strs[i] length:length]]; + [output flush]; + + NSData* data = + [rawOutput propertyForKey:NSStreamDataWrittenToMemoryStreamKey]; + GPBCodedInputStream* input = [GPBCodedInputStream streamWithData:data]; + TestAllTypes* message = [TestAllTypes parseFromCodedInputStream:input + extensionRegistry:nil + error:NULL]; + XCTAssertNotNil(message, @"Loop %zd", i); + // Ensure the string is there. NSString can consume the BOM in some + // cases, so don't actually check the string for exact equality. + XCTAssertTrue(message.defaultString.length > 0, @"Loop %zd", i); + } } @end diff --git a/objectivec/generate_well_known_types.sh b/objectivec/generate_well_known_types.sh index be9b38a5..73be50ff 100755 --- a/objectivec/generate_well_known_types.sh +++ b/objectivec/generate_well_known_types.sh @@ -12,6 +12,13 @@ set -eu readonly ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")") readonly ProtoRootDir="${ScriptDir}/.." +# Flag for continuous integration to check that everything is current. +CHECK_ONLY=0 +if [[ $# -ge 1 && ( "$1" == "--check-only" ) ]] ; then + CHECK_ONLY=1 + shift +fi + pushd "${ProtoRootDir}" > /dev/null if test ! -e src/google/protobuf/stubs/common.h; then @@ -46,4 +53,24 @@ declare -a RUNTIME_PROTO_FILES=( \ google/protobuf/type.proto \ google/protobuf/wrappers.proto) -./protoc --objc_out="${ProtoRootDir}/objectivec" ${RUNTIME_PROTO_FILES[@]} +# Generate to a temp directory to see if they match. +TMP_DIR=$(mktemp -d) +trap "rm -rf ${TMP_DIR}" EXIT +./protoc --objc_out="${TMP_DIR}" ${RUNTIME_PROTO_FILES[@]} +set +e +diff -r "${TMP_DIR}/google" "${ProtoRootDir}/objectivec/google" > /dev/null +if [[ $? -eq 0 ]] ; then + echo "Generated source for WellKnownTypes is current." + exit 0 +fi +set -e + +# If check only mode, error out. +if [[ "${CHECK_ONLY}" == 1 ]] ; then + echo "ERROR: The WKTs need to be regenerated! Run $0" + exit 1 +fi + +# Copy them over. +echo "Copying over updated WellKnownType sources." +cp -r "${TMP_DIR}/google/" "${ProtoRootDir}/objectivec/google/" diff --git a/objectivec/google/protobuf/Any.pbobjc.h b/objectivec/google/protobuf/Any.pbobjc.h index 79ec0fb7..439e3b37 100644 --- a/objectivec/google/protobuf/Any.pbobjc.h +++ b/objectivec/google/protobuf/Any.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -33,8 +36,36 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { GPBAny_FieldNumber_Value = 2, }; -/// `Any` contains an arbitrary serialized message along with a URL -/// that describes the type of the serialized message. +/// `Any` contains an arbitrary serialized protocol buffer message along with a +/// URL that describes the type of the serialized message. +/// +/// Protobuf library provides support to pack/unpack Any values in the form +/// of utility functions or additional generated methods of the Any type. +/// +/// Example 1: Pack and unpack a message in C++. +/// +/// Foo foo = ...; +/// Any any; +/// any.PackFrom(foo); +/// ... +/// if (any.UnpackTo(&foo)) { +/// ... +/// } +/// +/// Example 2: Pack and unpack a message in Java. +/// +/// Foo foo = ...; +/// Any any = Any.pack(foo); +/// ... +/// if (any.is(Foo.class)) { +/// foo = any.unpack(Foo.class); +/// } +/// +/// The pack methods provided by protobuf library will by default use +/// 'type.googleapis.com/full.type.name' as the type URL and the unpack +/// methods only use the fully qualified type name after the last '/' +/// in the type URL, for example "foo.bar.com/x/y.z" will yield type +/// name "y.z". /// /// /// JSON @@ -67,7 +98,7 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { @interface GPBAny : GPBMessage /// A URL/resource name whose content describes the type of the -/// serialized message. +/// serialized protocol buffer message. /// /// For URLs which use the schema `http`, `https`, or no schema, the /// following restrictions and interpretations apply: @@ -87,7 +118,7 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { /// used with implementation specific semantics. @property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL; -/// Must be valid serialized data of the above specified type. +/// Must be a valid serialized protocol buffer of the above specified type. @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end @@ -96,4 +127,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Any.pbobjc.m b/objectivec/google/protobuf/Any.pbobjc.m index 7cbf0def..6a1bf894 100644 --- a/objectivec/google/protobuf/Any.pbobjc.m +++ b/objectivec/google/protobuf/Any.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/Any.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBAnyRoot @implementation GPBAnyRoot @@ -85,4 +88,6 @@ typedef struct GPBAny__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Api.pbobjc.h b/objectivec/google/protobuf/Api.pbobjc.h index 3f7e99c6..d66df629 100644 --- a/objectivec/google/protobuf/Api.pbobjc.h +++ b/objectivec/google/protobuf/Api.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN @class GPBMethod; @@ -254,4 +257,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Api.pbobjc.m b/objectivec/google/protobuf/Api.pbobjc.m index 2b2f62ea..45a06e60 100644 --- a/objectivec/google/protobuf/Api.pbobjc.m +++ b/objectivec/google/protobuf/Api.pbobjc.m @@ -7,6 +7,9 @@ #import "google/protobuf/Type.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBApiRoot @implementation GPBApiRoot @@ -340,4 +343,6 @@ typedef struct GPBMixin__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Duration.pbobjc.h b/objectivec/google/protobuf/Duration.pbobjc.h index 3685a614..29888d6c 100644 --- a/objectivec/google/protobuf/Duration.pbobjc.h +++ b/objectivec/google/protobuf/Duration.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -93,4 +96,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Duration.pbobjc.m b/objectivec/google/protobuf/Duration.pbobjc.m index bb79c7a3..7dd6b64a 100644 --- a/objectivec/google/protobuf/Duration.pbobjc.m +++ b/objectivec/google/protobuf/Duration.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/Duration.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBDurationRoot @implementation GPBDurationRoot @@ -80,4 +83,6 @@ typedef struct GPBDuration__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Empty.pbobjc.h b/objectivec/google/protobuf/Empty.pbobjc.h index 6651ef71..f33db017 100644 --- a/objectivec/google/protobuf/Empty.pbobjc.h +++ b/objectivec/google/protobuf/Empty.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -45,4 +48,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Empty.pbobjc.m b/objectivec/google/protobuf/Empty.pbobjc.m index 5d7f8f19..88753aaf 100644 --- a/objectivec/google/protobuf/Empty.pbobjc.m +++ b/objectivec/google/protobuf/Empty.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/Empty.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBEmptyRoot @implementation GPBEmptyRoot @@ -56,4 +59,6 @@ typedef struct GPBEmpty__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/FieldMask.pbobjc.h b/objectivec/google/protobuf/FieldMask.pbobjc.h index 931f664c..47a239ba 100644 --- a/objectivec/google/protobuf/FieldMask.pbobjc.h +++ b/objectivec/google/protobuf/FieldMask.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -154,6 +157,33 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { /// { /// mask: "user.displayName,photo" /// } +/// +/// # Field Masks and Oneof Fields +/// +/// Field masks treat fields in oneofs just as regular fields. Consider the +/// following message: +/// +/// message SampleMessage { +/// oneof test_oneof { +/// string name = 4; +/// SubMessage sub_message = 9; +/// } +/// } +/// +/// The field mask can be: +/// +/// mask { +/// paths: "name" +/// } +/// +/// Or: +/// +/// mask { +/// paths: "sub_message" +/// } +/// +/// Note that oneof type names ("test_oneof" in this case) cannot be used in +/// paths. @interface GPBFieldMask : GPBMessage /// The set of field mask paths. @@ -167,4 +197,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/FieldMask.pbobjc.m b/objectivec/google/protobuf/FieldMask.pbobjc.m index 36fc758e..8c241afc 100644 --- a/objectivec/google/protobuf/FieldMask.pbobjc.m +++ b/objectivec/google/protobuf/FieldMask.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/FieldMask.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBFieldMaskRoot @implementation GPBFieldMaskRoot @@ -69,4 +72,6 @@ typedef struct GPBFieldMask__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/SourceContext.pbobjc.h b/objectivec/google/protobuf/SourceContext.pbobjc.h index 67b6d479..8775348e 100644 --- a/objectivec/google/protobuf/SourceContext.pbobjc.h +++ b/objectivec/google/protobuf/SourceContext.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -46,4 +49,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/SourceContext.pbobjc.m b/objectivec/google/protobuf/SourceContext.pbobjc.m index 4e8bf3d2..95007126 100644 --- a/objectivec/google/protobuf/SourceContext.pbobjc.m +++ b/objectivec/google/protobuf/SourceContext.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/SourceContext.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBSourceContextRoot @implementation GPBSourceContextRoot @@ -69,4 +72,6 @@ typedef struct GPBSourceContext__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Struct.pbobjc.h b/objectivec/google/protobuf/Struct.pbobjc.h index e2388e22..3924b4b7 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.h +++ b/objectivec/google/protobuf/Struct.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN @class GPBListValue; @@ -67,7 +70,7 @@ typedef GPB_ENUM(GPBStruct_FieldNumber) { /// The JSON representation for `Struct` is JSON object. @interface GPBStruct : GPBMessage -/// Map of dynamically typed values. +/// Unordered map of dynamically typed values. @property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary<NSString*, GPBValue*> *fields; /// The number of items in @c fields without causing the array to be created. @property(nonatomic, readonly) NSUInteger fields_Count; @@ -159,4 +162,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Struct.pbobjc.m b/objectivec/google/protobuf/Struct.pbobjc.m index 0601a4b2..60940027 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.m +++ b/objectivec/google/protobuf/Struct.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/Struct.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBStructRoot @implementation GPBStructRoot @@ -265,4 +268,6 @@ typedef struct GPBListValue__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.h b/objectivec/google/protobuf/Timestamp.pbobjc.h index b66b323a..925dca84 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.h +++ b/objectivec/google/protobuf/Timestamp.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -105,4 +108,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.m b/objectivec/google/protobuf/Timestamp.pbobjc.m index 14161159..f35e435d 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.m +++ b/objectivec/google/protobuf/Timestamp.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/Timestamp.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBTimestampRoot @implementation GPBTimestampRoot @@ -80,4 +83,6 @@ typedef struct GPBTimestamp__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Type.pbobjc.h b/objectivec/google/protobuf/Type.pbobjc.h index efaeab39..590d970b 100644 --- a/objectivec/google/protobuf/Type.pbobjc.h +++ b/objectivec/google/protobuf/Type.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN @class GPBAny; @@ -365,4 +368,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Type.pbobjc.m b/objectivec/google/protobuf/Type.pbobjc.m index 175c0233..5554a222 100644 --- a/objectivec/google/protobuf/Type.pbobjc.m +++ b/objectivec/google/protobuf/Type.pbobjc.m @@ -7,6 +7,9 @@ #import "google/protobuf/SourceContext.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBTypeRoot @implementation GPBTypeRoot @@ -685,4 +688,6 @@ typedef struct GPBOption__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Wrappers.pbobjc.h b/objectivec/google/protobuf/Wrappers.pbobjc.h index 0ca439a8..46510500 100644 --- a/objectivec/google/protobuf/Wrappers.pbobjc.h +++ b/objectivec/google/protobuf/Wrappers.pbobjc.h @@ -9,6 +9,9 @@ // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -174,4 +177,6 @@ NS_ASSUME_NONNULL_END CF_EXTERN_C_END +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) diff --git a/objectivec/google/protobuf/Wrappers.pbobjc.m b/objectivec/google/protobuf/Wrappers.pbobjc.m index b1b5be69..5cc6c2e4 100644 --- a/objectivec/google/protobuf/Wrappers.pbobjc.m +++ b/objectivec/google/protobuf/Wrappers.pbobjc.m @@ -5,6 +5,9 @@ #import "google/protobuf/Wrappers.pbobjc.h" // @@protoc_insertion_point(imports) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #pragma mark - GPBWrappersRoot @implementation GPBWrappersRoot @@ -412,4 +415,6 @@ typedef struct GPBBytesValue__storage_ { @end +#pragma clang diagnostic pop + // @@protoc_insertion_point(global_scope) |