* adds string-to-int and int-to-string methods to enums
* remove check for valueToName property in EnumTrait
* Remove unused imports
* Update to avoid using EnumTrait
* Remove EnumTrait
* Update enum types
* Move name and value methods into generated classes
* Remove functions from GPBUtil
* Test well known enums
* Implement enum value to/from name in c extension
* Only generate use statement when namespace is present
In some cases proto files that want/need to use the objc_class_prefix option have
types that already have the prefix on a subset of their names. In this case we don't
want to duplicate the prefix.
Added tests for this (and prefixes in general).
The code now matches what the comment above it actually generates.
Also tweak that code so it actually compiles for me, and to avoid
embedding /* and */ in comments because that's generally a reasonable
thing to trigger warnings.
Instead of using DEPRECATED_ATTRIBUTE from AvailabilityMacros.h, we should introduce a Google-specific Objective-C protobuf deprecation annotation. This helps address IWYU issues with using DEPRECATED_ATTRIBUTE and also enables allows clients to redefine the macro to treat protobuf warnings differently than other types of warnings (e.g., treating protobuf deprecation warnings as errors or ignoring them).
For messages that have multiple extension ranges, this will improve things
by avoiding repeated work. For messages with a single range, it should
be a wash.
- Sort the list of set extensions once during serialization and reuse the list.
- Break out of the serialization loop as soon as the loop has moved pasted at
accepted range for field ids.
- removed use of GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
in favor of deleting them C++11 style.
- removed forward declarations of protobuf core types.
- ensured that namespaces "google" and "protobuf" are
always opened/closed together.
Using NSCoding with a Message that has extensions is risky because
when reloaded, there is no way to provide a registry through the
NSCoding plumbing, so output a warnings to atleast give developers
a hint about the potential issues.
The builds were failing under Xcode 10 because of the new build system.
Even when reverted to the old build system, the build was failing
on the analyzer and swift bridging header, so it seems the general
logic for searching for things was changed in a way the setting does
not always cover.
- Disable HeaderMaps.
- Set user header search paths instead of system search paths.
- Turn off always search user paths (now recommended).
Tested in Xcode 10.1 and 9.4.1; both are able to build/pass with this.
Previously --cpp_out:lite was available to force the optimization mode
to the lite runtime. This adds --cpp_out=speed:...
which is needed to override the file specific options in cases where
libprotobuf-mutator is used for fuzzing since it depends on reflection.
Signed-off-by: Allen Webb <allenwebb@google.com>
* Increase C# default recursion limit to 100
This matches the Java and C++ defaults.
* Change compatibility tests to use execution-time default recursion limit
This way the same tests should pass against all versions, even
if the recursion limit changes. (The tests will be testing whether
different messages work, admittedly - but that's probably fine.)
We have code for converting C/C++/Objc keywords that appear in protos
to convert them so that they can be compiled.
One of the things we need to be careful of is accidentally overriding methods
that Apple declares in NSObject. It turns out that we have run into issues
where we conflict with "hidden" methods in NSObject or methods added by
categories. method_dump.sh collects all of the methods we care about for
macOS and iOS and dumps them into objectivec_nsobject_methods.h which
is then included in objectivec_helpers.cc as part of the build.
Added a pile of tests to verify that conversions are happening as expected.