[ObjC] Fix issue using GPBBootstrap.h only.

GPB_ENUM_FWD_DECLARE needs `int32_t`, so add the import so GPBBootstrap.h
stands on its own without needing users to import something else.

Add another compile test file to ensure this doesn't break.

PiperOrigin-RevId: 610403337
pull/15932/head
Thomas Van Lenten 9 months ago committed by Copybara-Service
parent 9c0d130168
commit 9f52d5e380
  1. 3
      objectivec/GPBBootstrap.h
  2. 4
      objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj
  3. 4
      objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj
  4. 4
      objectivec/ProtocolBuffers_tvOS.xcodeproj/project.pbxproj
  5. 20
      objectivec/Tests/GPBCompileTest24.m

@ -5,6 +5,9 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
// For int32_t in GPB_ENUM/GPB_ENUM_FWD_DECLARE below.
#import <stdint.h>
/**
* The Objective C runtime has complete enough info that most protos dont end
* up using this, so leaving it on is no cost or very little cost. If you

@ -89,6 +89,7 @@
F47CF94223D902D500C7B24C /* GPBApi.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF93A23D902D500C7B24C /* GPBApi.pbobjc.m */; };
F47CF94323D902D500C7B24C /* GPBAny.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF93B23D902D500C7B24C /* GPBAny.pbobjc.m */; };
F47CF94623D902D500C7B24C /* GPBDuration.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF93E23D902D500C7B24C /* GPBDuration.pbobjc.m */; };
F4A92AFD2B88E105001E4F69 /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A92AFC2B88E105001E4F69 /* GPBCompileTest24.m */; };
F4B51B1E1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */; };
F4C4B9E41E1D976300D3B61D /* GPBDictionaryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C4B9E21E1D974F00D3B61D /* GPBDictionaryTests.m */; };
F4F53F8A219CC4F2001EABF4 /* text_format_extensions_unittest_data.txt in Resources */ = {isa = PBXBuildFile; fileRef = F4F53F89219CC4F2001EABF4 /* text_format_extensions_unittest_data.txt */; };
@ -256,6 +257,7 @@
F47CF93C23D902D500C7B24C /* GPBDuration.pbobjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBDuration.pbobjc.h; sourceTree = "<group>"; };
F47CF93D23D902D500C7B24C /* GPBApi.pbobjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBApi.pbobjc.h; sourceTree = "<group>"; };
F47CF93E23D902D500C7B24C /* GPBDuration.pbobjc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBDuration.pbobjc.m; sourceTree = "<group>"; };
F4A92AFC2B88E105001E4F69 /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; };
F4AC9E1D1A8BEB3500BD6E83 /* unittest_cycle.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_cycle.proto; sourceTree = "<group>"; };
F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPBObjectiveCPlusPlusTest.mm; sourceTree = "<group>"; };
F4B6B8AF1A9CC98000892426 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; };
@ -475,6 +477,7 @@
F40EE486206BF8AF0071091A /* GPBCompileTest21.m */,
F40EE48A206BF8B00071091A /* GPBCompileTest22.m */,
F40EE487206BF8B00071091A /* GPBCompileTest23.m */,
F4A92AFC2B88E105001E4F69 /* GPBCompileTest24.m */,
5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */,
F4353D1C1AB8822D005A6198 /* GPBDescriptorTests.m */,
F4C4B9E21E1D974F00D3B61D /* GPBDictionaryTests.m */,
@ -737,6 +740,7 @@
F401DC331A8E5C0200FCC765 /* GPBArrayTests.m in Sources */,
F40EE4B4206BF8B90071091A /* GPBCompileTest10.m in Sources */,
F4353D361AC06F10005A6198 /* GPBDictionaryTests+Int64.m in Sources */,
F4A92AFD2B88E105001E4F69 /* GPBCompileTest24.m in Sources */,
F40EE4C0206BF8B90071091A /* GPBCompileTest22.m in Sources */,
F40EE4B2206BF8B90071091A /* GPBCompileTest08.m in Sources */,
F40EE4BB206BF8B90071091A /* GPBCompileTest17.m in Sources */,

@ -90,6 +90,7 @@
F47CF96923D903C600C7B24C /* GPBTimestamp.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF95523D903C600C7B24C /* GPBTimestamp.pbobjc.m */; };
F47CF96C23D903C600C7B24C /* GPBType.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF95823D903C600C7B24C /* GPBType.pbobjc.m */; };
F47CF96D23D903C600C7B24C /* GPBAny.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF95923D903C600C7B24C /* GPBAny.pbobjc.m */; };
F4A92AFF2B88E663001E4F69 /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A92AFE2B88E662001E4F69 /* GPBCompileTest24.m */; };
F4B51B1C1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */; };
F4C4B9E71E1D97BF00D3B61D /* GPBDictionaryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C4B9E51E1D97BB00D3B61D /* GPBDictionaryTests.m */; };
F4F53F8C219CC5DF001EABF4 /* text_format_extensions_unittest_data.txt in Resources */ = {isa = PBXBuildFile; fileRef = F4F53F8B219CC5DF001EABF4 /* text_format_extensions_unittest_data.txt */; };
@ -259,6 +260,7 @@
F47CF95823D903C600C7B24C /* GPBType.pbobjc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBType.pbobjc.m; sourceTree = "<group>"; };
F47CF95923D903C600C7B24C /* GPBAny.pbobjc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBAny.pbobjc.m; sourceTree = "<group>"; };
F47CF95A23D903C600C7B24C /* GPBSourceContext.pbobjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBSourceContext.pbobjc.h; sourceTree = "<group>"; };
F4A92AFE2B88E662001E4F69 /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; };
F4AC9E1C1A8BEB1000BD6E83 /* unittest_cycle.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_cycle.proto; sourceTree = "<group>"; };
F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPBObjectiveCPlusPlusTest.mm; sourceTree = "<group>"; };
F4B6B8B01A9CC99500892426 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; };
@ -481,6 +483,7 @@
F40EE4CB206BF9170071091A /* GPBCompileTest21.m */,
F40EE4CF206BF9170071091A /* GPBCompileTest22.m */,
F40EE4CC206BF9170071091A /* GPBCompileTest23.m */,
F4A92AFE2B88E662001E4F69 /* GPBCompileTest24.m */,
5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */,
F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */,
F4C4B9E51E1D97BB00D3B61D /* GPBDictionaryTests.m */,
@ -744,6 +747,7 @@
F401DC351A8E5C6F00FCC765 /* GPBArrayTests.m in Sources */,
F40EE4F9206BF91E0071091A /* GPBCompileTest10.m in Sources */,
F4353D441AC06F31005A6198 /* GPBDictionaryTests+Int64.m in Sources */,
F4A92AFF2B88E663001E4F69 /* GPBCompileTest24.m in Sources */,
F40EE505206BF91E0071091A /* GPBCompileTest22.m in Sources */,
F40EE4F7206BF91E0071091A /* GPBCompileTest08.m in Sources */,
F40EE500206BF91E0071091A /* GPBCompileTest17.m in Sources */,

@ -90,6 +90,7 @@
F47CF99323D904E600C7B24C /* GPBWrappers.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF97F23D904E600C7B24C /* GPBWrappers.pbobjc.m */; };
F47CF99423D904E600C7B24C /* GPBAny.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF98023D904E600C7B24C /* GPBAny.pbobjc.m */; };
F47CF99623D904E600C7B24C /* GPBSourceContext.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F47CF98223D904E600C7B24C /* GPBSourceContext.pbobjc.m */; };
F4A92B012B88E683001E4F69 /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A92B002B88E683001E4F69 /* GPBCompileTest24.m */; };
F4B51B1C1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */; };
F4C4B9E71E1D97BF00D3B61D /* GPBDictionaryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4C4B9E51E1D97BB00D3B61D /* GPBDictionaryTests.m */; };
F4F53F8C219CC5DF001EABF4 /* text_format_extensions_unittest_data.txt in Resources */ = {isa = PBXBuildFile; fileRef = F4F53F8B219CC5DF001EABF4 /* text_format_extensions_unittest_data.txt */; };
@ -259,6 +260,7 @@
F47CF98023D904E600C7B24C /* GPBAny.pbobjc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBAny.pbobjc.m; sourceTree = "<group>"; };
F47CF98123D904E600C7B24C /* GPBStruct.pbobjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBStruct.pbobjc.h; sourceTree = "<group>"; };
F47CF98223D904E600C7B24C /* GPBSourceContext.pbobjc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBSourceContext.pbobjc.m; sourceTree = "<group>"; };
F4A92B002B88E683001E4F69 /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; };
F4AC9E1C1A8BEB1000BD6E83 /* unittest_cycle.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_cycle.proto; sourceTree = "<group>"; };
F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPBObjectiveCPlusPlusTest.mm; sourceTree = "<group>"; };
F4B6B8B01A9CC99500892426 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; };
@ -481,6 +483,7 @@
F40EE4CB206BF9170071091A /* GPBCompileTest21.m */,
F40EE4CF206BF9170071091A /* GPBCompileTest22.m */,
F40EE4CC206BF9170071091A /* GPBCompileTest23.m */,
F4A92B002B88E683001E4F69 /* GPBCompileTest24.m */,
5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */,
F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */,
F4C4B9E51E1D97BB00D3B61D /* GPBDictionaryTests.m */,
@ -744,6 +747,7 @@
F401DC351A8E5C6F00FCC765 /* GPBArrayTests.m in Sources */,
F40EE4F9206BF91E0071091A /* GPBCompileTest10.m in Sources */,
F4353D441AC06F31005A6198 /* GPBDictionaryTests+Int64.m in Sources */,
F4A92B012B88E683001E4F69 /* GPBCompileTest24.m in Sources */,
F40EE505206BF91E0071091A /* GPBCompileTest22.m in Sources */,
F40EE4F7206BF91E0071091A /* GPBCompileTest08.m in Sources */,
F40EE500206BF91E0071091A /* GPBCompileTest17.m in Sources */,

@ -0,0 +1,20 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
// This is a test including a single public header to ensure things build.
// It helps test that imports are complete/ordered correctly.
#import "GPBBootstrap.h"
GPB_ENUM_FWD_DECLARE(SomeProtoBasedEnum);
// A prototype that uses the fwd decls.
extern enum SomeProtoBasedEnum SomeFunction(void);
// Something in the body of this file so the compiler/linker won't complain
// about an empty .o file.
__attribute__((visibility("default"))) char dummy_symbol_24 = 0;
Loading…
Cancel
Save