[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
diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m
index 2e46ebe..a6bedeb 100644
--- a/objectivec/GPBMessage.m
+++ b/objectivec/GPBMessage.m
@@ -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 @@
}
}
-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];
diff --git a/objectivec/GPBMessage_PackagePrivate.h b/objectivec/GPBMessage_PackagePrivate.h
index 1b3a993..8dc82e4 100644
--- a/objectivec/GPBMessage_PackagePrivate.h
+++ b/objectivec/GPBMessage_PackagePrivate.h
@@ -86,15 +86,6 @@
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.
diff --git a/objectivec/GPBProtocolBuffers_RuntimeSupport.h b/objectivec/GPBProtocolBuffers_RuntimeSupport.h
index 804a68a..297173d 100644
--- a/objectivec/GPBProtocolBuffers_RuntimeSupport.h
+++ b/objectivec/GPBProtocolBuffers_RuntimeSupport.h
@@ -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"
diff --git a/objectivec/GPBStruct.pbobjc.h b/objectivec/GPBStruct.pbobjc.h
index 8f2f12c..b0cc299 100644
--- a/objectivec/GPBStruct.pbobjc.h
+++ b/objectivec/GPBStruct.pbobjc.h
@@ -32,7 +32,7 @@
* `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) {
/**