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
Include a comment in the generated header about there being helpers
in GPBWellKnowTypes.h
Generate some extra code for the WKTs that have categories to help
ensure the categories get linked so developers don't have to use
-ObjC in some cases.
PiperOrigin-RevId: 589179237
This restores the behavior of `-[GPBMessage writeToOutputStream:]` throwing an
exception if the underlying `GPBCodedOutputStream` failed to flush.
`GPBDictionary` and `GPBUnknownFieldSet` could also have theoretically thrown
exceptions from just about any method (although not for disk I/O reasons), so
this also restores that functionality by explicitly flushing before deallocating
the `GPBCodedOutputStream`.
PiperOrigin-RevId: 580207004
If `-[GPBCodedOutputStream flush]` failed (e.g., because the filesystem
was out of space), then `-[GPBCodedOutputStream dealloc]` would throw
an exception.
`-dealloc` cannot fail, so the only thing to do in this case is to silently
swallow the exception.
PiperOrigin-RevId: 579916429
There was the potential for if the serialization failed, the final
release of the CodedOutputStream could flush some data back into the
return result; instead insure a zero length data is always returned
for that error case.
PiperOrigin-RevId: 579865501
This change moves almost everything in the `upb/` directory up one level, so
that for example `upb/upb/generated_code_support.h` becomes just
`upb/generated_code_support.h`. The only exceptions I made to this were that I
left `upb/cmake` and `upb/BUILD` where they are, mostly because that avoids
conflict with other files and the current locations seem reasonable for now.
The `python/` directory is a little bit of a challenge because we had to merge
the existing directory there with `upb/python/`. I made `upb/python/BUILD` into
the BUILD file for the merged directory, and it effectively loads the contents
of the other BUILD file via `python/build_targets.bzl`, but I plan to clean
this up soon.
PiperOrigin-RevId: 568651768
A couple weeks ago we moved upb into the protobuf Git repo, and this change
continues the merger of the two repos by making them into a single Bazel repo.
This was mostly a matter of deleting upb's WORKSPACE file and fixing up a bunch
of references to reflect the new structure.
Most of the changes are pretty mechanical, but one thing that needed more
invasive changes was the Python script for generating CMakeLists.txt,
make_cmakelists.py. The WORKSPACE file it relied on no longer exists with this
change, so I updated it to hardcode the information it needed from that file.
PiperOrigin-RevId: 564810016
Scrub all the objc related sources for references to "syntax"
and update them to no longer tie things accordingly.
The ObjC Protos `GPBFileDescriptor` concept still exposes the
`syntax`, but it was already marked as deprecated. This will be
removed in the future as nothing should need to look at the value.
Validate that all generation calls are on the helpers to get the
editions support from the C++ code.
PiperOrigin-RevId: 555971288
ctype can not be used for none string/bytes fields. ctye=CORD can not be used for extensions. A new macro PROTOBUF_FUTURE_REMOVE_WRONG_CTYPE is added that will be flipped for our next breaking release.
PiperOrigin-RevId: 555615362
With some optimizer flags, GPBCodedOutputStream results in a lot of
code bloat, for now just prevent the new helper related to
NSOutputStream from being inlined to keep that in check.
PiperOrigin-RevId: 554525631
A write succeed but only write out a subset of the requested amount
of data, handle that via a helper that will loop and advance as need
to completely write out the data.
PiperOrigin-RevId: 553516360
There are whatespace changes because I couldn't get some of the
generated CPreProcessor things to line up in the exact same way.
PiperOrigin-RevId: 547188309
This fix works in Bazel 5 and 6, but the original `import pddm` only works in Bazel 5. This is preventing our upgrade to Bazel 6 that will reduce our mac flakes in CI.
PiperOrigin-RevId: 543565397
Not really sure why things changed and started having this problem, but
cl/536414905 & cl/536708284 just keep swapping this so hopefully changing
the formatting to avoid this going forward.
PiperOrigin-RevId: 537035911