[ObjC] Small cleanups to package level headers

- Reduce what headers the runtime import needs.
- Remove stale function prototype.
- Move one function to be full scoped to a single file.

PiperOrigin-RevId: 512073294
pull/12050/head
Thomas Van Lenten 2 years ago committed by Copybara-Service
parent 1501afeb23
commit 9c29c404bf
  1. 10
      objectivec/GPBMessage.m
  2. 9
      objectivec/GPBMessage_PackagePrivate.h
  3. 3
      objectivec/GPBProtocolBuffers_RuntimeSupport.h
  4. 2
      objectivec/GPBStruct.pbobjc.h

@ -47,6 +47,12 @@
#import "GPBUnknownFieldSet_PackagePrivate.h"
#import "GPBUtilities_PackagePrivate.h"
// Returns a new instance that was automatically created by |autocreator| for
// its field |field|.
static GPBMessage *GPBCreateMessageWithAutocreator(Class msgClass, GPBMessage *autocreator,
GPBFieldDescriptor *field)
__attribute__((ns_returns_retained));
// Direct access is use for speed, to avoid even internally declaring things
// read/write, etc. The warning is enabled in the project to ensure code calling
// protos can turn on -Wdirect-ivar-access without issues.
@ -827,8 +833,8 @@ static void ExtensionMergeFromInputStream(GPBExtensionDescriptor *extension, BOO
}
}
GPBMessage *GPBCreateMessageWithAutocreator(Class msgClass, GPBMessage *autocreator,
GPBFieldDescriptor *field) {
static GPBMessage *GPBCreateMessageWithAutocreator(Class msgClass, GPBMessage *autocreator,
GPBFieldDescriptor *field) {
GPBMessage *message = [[msgClass alloc] init];
message->autocreator_ = autocreator;
message->autocreatorField_ = [field retain];

@ -86,15 +86,6 @@ typedef struct GPBMessage_Storage *GPBMessage_StoragePtr;
CF_EXTERN_C_BEGIN
// Call this before using the readOnlySemaphore_. This ensures it is created only once.
void GPBPrepareReadOnlySemaphore(GPBMessage *self);
// Returns a new instance that was automatically created by |autocreator| for
// its field |field|.
GPBMessage *GPBCreateMessageWithAutocreator(Class msgClass, GPBMessage *autocreator,
GPBFieldDescriptor *field)
__attribute__((ns_returns_retained));
// Returns whether |message| autocreated this message. This is NO if the message
// was not autocreated by |message| or if it has been mutated since
// autocreation.

@ -36,7 +36,6 @@
// clang-format on
#import "GPBDescriptor_PackagePrivate.h"
#import "GPBExtensionInternals.h"
#import "GPBMessage_PackagePrivate.h"
#import "GPBMessage.h"
#import "GPBRootObject_PackagePrivate.h"
#import "GPBUtilities_PackagePrivate.h"

@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
* `NullValue` is a singleton enumeration to represent the null value for the
* `Value` type union.
*
* The JSON representation for `NullValue` is JSON `null`.
* The JSON representation for `NullValue` is JSON `null`.
**/
typedef GPB_ENUM(GPBNullValue) {
/**

Loading…
Cancel
Save