* Remove deprecated version of SetTotalBytesLimit()
It has been depcated for at least 3 years.
Worst (backward incompatible) things happened during this period.
I think this method could be safely removed, as the client code fix is trivial.
* Fix coded_stream_unittest.cc
* fix#7074 Safely handle setlocale
`setlocale` returns a pointer to a buffer containing the current locale name.
This needs to be copied into a `std::string` or it will be overwritten by the next call.
Trying to call `setlocale` with a non-null, invalid pointer can have unpredictable results, such as
```
[ RUN ] StringPrintfTest.Multibyte
minkernel\crts\ucrt\src\appcrt\convert\mbstowcs.cpp(246) : Assertion failed: (pwcs == nullptr && sizeInWords == 0) || (pwcs != nullptr && sizeInWords > 0)
```
`setlocale` can also return a `nullptr` if it fails, but we assert against that.
* stringprintf_unittest.cc: Replace `new char[n+1]` with `std::array`
Prefer safer alternative to naked pointers.
This is a follow-up to 1dd313cd0611ac13257c075a977d46c874c42652
- Accept "-" as the expected prefixes file and turn off all validations of
prefixes (even the Apple conventions).
- Reflow some of the prefix checks to hopefully make things a little easier
to follow.
- Don't print warnings about updates to the expected prefix file until there is
a file.
This likely should have been the default from the start, as without it is way to
common to get symbol collisions between different proto files. It would be nice
to support a "migration" mode where both names are created to aid it moving code
to this model, but with ObjC `@class` decls being very common to avoid header
imports to control rebuilds/etc., it doesn't work as an `@class` usage will
error if one also uses `@compatibility_alias`. Falling back to `#define` the two
together also doesn't work as the header with the `@class` will cause methods to
get defined with one interface, but when methods taking those types are define
will likely #import the generate header and thus get the define and end up with
a different signature. So for now, there is no migration support and code has to
be updated in one shot with enable the new prefixing.
- Add a generation option to enable this change in generation.
- Add a second generation option to provide a list of proto package that are
exceptions from using the proto package. This allows easier
migration/updating of code one package at a time.
Adds an option to protoc `--objc_opt=elide_message_metadata` to remove all the property
metadata from message classes. This significantly reduces the codegen size of the clases.
The downside is that iterating through properties using objective c runtime calls will no
longer function. This is mitigated by the fact that most (all?) of the information that
folks are interested in can be extracted via the message descriptor.
We do this by defining our own classes using the `GPB_MESSAGE_SUBCLASS_IMPL` macro.
CreateCodedInput is created from the underlying array behind the ByteString.
If this was created from a larger array (via Memory<byte> or ArrayPool etc)
then the CodedInput refers to the wrong section of memory.
Change is to add the offset and count like the other methods that use the
ArraySegment (ToString, ToBase64, WriteTo).