As of C23, `va_start` no longer requires a second argument, and ignores it when provided. So, the parameter named `unused` is now...unused.
PiperOrigin-RevId: 683183750
Import both the public and private header into impls when the
private is needed.
Also update the tests to use more complete imports.
PiperOrigin-RevId: 671388271
This past reliance doesn't work well with Swift, and the sources
were trying to over hand optimize to minimize rebuilds, and that
likely isn't worth the trouble, so explicit imports.
The remaining places that still use them are where they are
needed within the header to deal with relationships between
the local definitions or where there is a cycle between the
headers and it allows either one to be imported first and still
get a complete definition in the using context.
PiperOrigin-RevId: 671379912
The old generated code suppressed warnings broadly to support protobuf
deprecations like this showing to users, but the previous commit does
provide a debug log statement for the usages.
PiperOrigin-RevId: 670581568
Migrate some internals of the library off the older apis.
Also mark some of the old apis as deprecated, but the old generated code
suppressed warnings broadly to support protobuf deprecations.
PiperOrigin-RevId: 668003974
Since a group GPBUnknownField uses a GPBUnknownFields and that is mutable, it needs to be copied so two instances aren't linked.
PiperOrigin-RevId: 663323972
The api is annotated that it isn't valid, but incase someone calling code isn't
annotated correct and someone returns nil for another nonnull api, it could happen,
so make it an explicit failure just to be safe.
PiperOrigin-RevId: 662935009
GPBUnknownFields will be going away in the next major release of the ObjC
Protobuf runtime. Code should be updated to make use of GPBUnknownFields
instead.
PiperOrigin-RevId: 659963056
Default to collecting unknown fields as data and then create the
`GPBUnknownFieldSet` on demand when requested.
This should reduce the as the extra objects are created until requested
and clears the way to eventually deprecated `GPBUnknownFieldSet` in the
future.
This also fixes the failing conformance test related to keeping the ordering.
PiperOrigin-RevId: 655929316
`GPBTextFormatForMessage()` will contain any information for unknown fields.
And it clears the way for `GPBUnknownFieldSet` to eventually be deprecated
also.
PiperOrigin-RevId: 655184316
Make a new internal api for collecting up the unknown group fields
that will be used in a future change.
Add testing for the new api and for unknown field parsing of groups in
general.
PiperOrigin-RevId: 654875605
Also mark the helper as not inline able to avoid the code being over duplicated
within the file with some compiler optimizations turned on.
PiperOrigin-RevId: 654826102
- Follow upb and only accept the first value for `type_id` and `message`
- Reflow some of the logic to hopefully make things a little easier to follow/clear.
- Validate some more assertion about things the extensions for a MessageSet.
PiperOrigin-RevId: 652545240
Ensure all apis are called directly in tests.
Correct `GPBUnknownField` `-copy` to not have to make a new instance
since it is immutable in the new form.
PiperOrigin-RevId: 650690942
Port of the interesting `GPBUnknownFieldsSet` tests to `GPBUnknownFields`
as they provide coverage of general handing of unknown fields during parsing.
Also tweak the `Set` tests to actually use a registry to confirm behaviors around
extensions where the test previously wasn't as complete.
PiperOrigin-RevId: 650660181
Move some of the new logic out of `GPBUnknownField` so it will end up as a much
simpler "container", with all the serialization logic inside `GPBUnknownFields`
instead.
Also move some of the internal logic needed into static C functions to reduce the
ObjC class overhead of `GPBUnknownFields`.
This was all inspired by realizing during serialization related apis the `type` of
each field was being examined multiple times and reduces that in addition to reducing
the number of methods being invoked.
PiperOrigin-RevId: 650631975
`GPBUnknownFields` additions:
- Provide `Optional` based apis for the `getFirst*` apis.
- Map the `NSFastEnumeration` over as a `Sequence` to support looping over the fields.
`GPBUnknownField` addition:
- Add an `enum` with associated values to provide a more type-safe way for inspection.
PiperOrigin-RevId: 649090744
`GPBUnknownFields` will be the eventually replacement for `GPBUnknownFieldSet`. This
introduces the type and the changes to `GPBUnknownField`.
The new api will preserve the wire ordering of unknown fields. This is now checked
in conformance tests.
While this adds the type changes and tests them, it does not yet wire the changes
in to the rest of the Runtime, so the conformance tests still done pass.
`GPBUnknownFieldSet` also hasn't been deprecated yet, that will come in later with
the wiring in to the runtime.
PiperOrigin-RevId: 648361455
This simply exposes preexisting logic. This read-only API is for convenience and doesn't reveal any information that was not already available. `[GPBCodedInputStream position]` is already a public API. The `limit` is known to the user because it's specified by them.
PiperOrigin-RevId: 635502694
This prevents shadowing of `java.lang` package commonly used in protobuf gencode. Existing extensions named `java` may or may not previously fail to compile depending on if the contents of their .proto result in gencode using `java.lang`. This is needed to fix `java_features.proto` lite gencode since enum gencode uses `java.lang`. Fields named `java` should already be escaped.
*Warning: This may break user code for existing protos with extensions named `java`. References to the extension should be renamed to use `java_` e.g. registry.add(GeneratedClassName.java_)*
PiperOrigin-RevId: 632508249
Move away from looking up selectors at proto initialization time to doing optimized string compares at implementation resolving time.
PiperOrigin-RevId: 623183331
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
CocoaPods fails spec validation for some warnings, so use a local
to avoid warnings for 64->32bit implicit conversions. This comes up
for watchOS builds.
PiperOrigin-RevId: 601849919