Commit Graph

5423 Commits

Author SHA1 Message Date
Ewout
7b8f571756 Ruby JSON encoding omits zero-length repeated fields by default.
This makes it behave the same way as the other implementations.
It is also nice to always encode an empty message as {}.
2018-02-20 17:13:21 +01:00
Jie Luo
e34ec6077a
Only check filenames when end with .py in _CalledFromGeneratedFile() ()
* Cython's stack does not have .py file name. Only check filenames when end with .py for _CalledFromGeneratedFile()
2018-02-09 15:54:03 -08:00
Yilun Chong
96b535cc2f
Merge pull request from BSBandme/down_integ_benchmark
Sync internal benchmark changes
2018-02-09 12:36:35 -08:00
Yilun Chong
6cd4ec4972 Sync internal benchmark changes 2018-02-09 11:47:00 -08:00
Thomas Van Lenten
4da7706d74 Remove stray indent on normal imports. 2018-02-08 15:51:17 -05:00
Feng Xiao
b8e47830d4
Merge pull request from nico/nofall
Remove use of GOOGLE_FALLTHROUGH_INTENDED from protobuf.
2018-02-08 10:53:41 -08:00
Thomas Van Lenten
07f023188e Fix up the docs to mention the WKTs generated files also.
Fixes 
2018-02-07 10:41:21 -05:00
Nico Weber
c66dd6c276 Remove use of GOOGLE_FALLTHROUGH_INTENDED from protobuf.
Chrome is running into two issues with the use of this macro
in open-source protobuf (https://crbug.com/809157):

1. GOOGLE_FALLTHROUGH_INTENDED is defined to nothing on __APPLE__
   platforms, which blocks us from enabling -Wimplicit-fallthrough
   on Mac and iOS. (We use a hermetic self-built modern clang,
   so whatever Xcode bug that exclusion might be for doesn't apply
   to us.)

2. It's in a public header file, and it's included in a public header file.
   When clang suggests adding [[clang::fallthrough]], it checks if it knows of
   a macro expanding to that and if so, suggests inserting that. Since lots of
   chrome code includes protobuf headers, it often suggests inserting
   GOOGLE_FALLTHROUGH_INTENDED (from protobuf) instead of the correct
   FALLTHROUGH (from chrome's base).

Since the fallthrough doens't do anyting useful, just remove it.
Long ago, this might have had perf impact, but d64a2d9941 added a
parsing fast path that calls this switch as slow fallback, so it should
be off the hot path nowadays.

No intended behavior change.

This is the public version of internal change 184824132.
2018-02-07 08:55:36 -05:00
Feng Xiao
82e0231607
Merge pull request from Mizux/master
Various CMake Update
2018-02-02 11:47:31 -08:00
Feng Xiao
5dad7cce19
Merge pull request from davido/support_java9
Bazel: Support building with Java 9
2018-02-01 15:11:56 -08:00
Yilun Chong
9717d6fa17
Merge pull request from BSBandme/upgrade_benchmark_submodule
Upgrade benchmark submodule
2018-02-01 13:50:45 -08:00
Corentin Le Molgat
1ec9beb477 Use NEW behaviour for project VERSION variables.
cf https://cmake.org/cmake/help/latest/policy/CMP0048.html#policy:CMP0048
2018-02-01 20:31:50 +01:00
Corentin Le Molgat
8dd0f4e557 Even with MSVC enable zlib support as default behaviour. 2018-02-01 20:31:36 +01:00
Corentin Le Molgat
f7a05844eb Add CMake ALIAS targets
We follow the findProtobuf.cmake naming convention
to ease the use of protobuf as cmake subproject
2018-02-01 20:31:36 +01:00
Corentin Le Molgat
3bc0282fb6 Add VERSION property to CMake library targets 2018-02-01 20:31:36 +01:00
Yilun Chong
7f1491506c upgrade submodule 2018-02-01 11:11:00 -08:00
Jisi Liu
4e2bd9e656
Merge pull request from brunokim/patch-1
Fix link markup in third party list.
2018-02-01 09:41:51 -08:00
Bruno Kim Medeiros Cesar
0d397a1756
Fix link markup in third party list. 2018-02-01 02:08:51 -02:00
Adam Cozzette
6456e5d646
Merge pull request from mrpi/master
Create std::string in Arena memory
2018-01-31 14:31:58 -08:00
David Ostrovsky
85b488f7fa Bazel: Support building with Java 9
Fixes: .

Bazel@HEAD supports Java 9.

The current code has one single issue with Java 9 compliance: the usage
of sun.misc package. We add jdk.unsupported module with --add-modules
compiler option for now. Long term, the usage of non public API should
be avoided.

To build with Java 9, build custom bazel version and issue:

  $ bazel --host_javabase=/usr/lib64/jvm/java-9-openjdk build \
    --javacopt='--release 9' \
    --java_toolchain=@bazel_tools//tools/jdk:toolchain_jdk9 \
   :protobuf_java
2018-01-31 23:12:04 +01:00
Thomas Van Lenten
cf016a42e6 Work around strange error with atomic and swift under Xcode 8.3.3.
Haven't been able to make a repo case, but this should "fix" the problem
by avoid it completely.

- Move readOnlySemaphore_ into the .m file so it isn't exposed in any
  header.
- Move GPBGetObjectIvarWithField() also to go with the new limited
  visibility on the readOnlySemaphore_.
2018-01-31 16:57:53 -05:00
Thomas Van Lenten
d570d48648 Don't assume c-strings are 4 byte aligned.
The Undefined Behavior sanitizer flags one part of the unittests for this.
For default values for `bytes` we write a length on the front of a c-string
in the static data, apparently the compiler/linker doesn't always make this
4 byte aligned, so it get flagged for undefined/degraded performance. Avoid
this by using memcpy instead.
2018-01-31 15:40:22 -05:00
Thomas Van Lenten
d83837ded5 Fix to use "nil" instead of "NULL" for objc objects. 2018-01-31 14:24:51 -05:00
Thomas Van Lenten
81aeed082e Work around the static analyzer false report. 2018-01-31 14:24:51 -05:00
Thomas Van Lenten
953adb16ff Add casts to removed undefined behaviors around shifts.
Fixes 
Fixes 
2018-01-31 12:36:54 -05:00
Feng Xiao
b718551571
Merge pull request from nlochschmidt/patch-1
Propose kotlinx.serialization as 3rd party lib
2018-01-30 13:39:15 -08:00
Thomas Van Lenten
204a6413d6 Move kokoro macOS builds to to Xcode 9.1. 2018-01-30 15:10:11 -05:00
Ludger Sprenker
14e8852fe4
Fix -fpermissive: '<::' cannot begin a template-argument list
'<:' is an alternate spelling for '['.
2018-01-30 18:14:49 +01:00
Niklas Lochschmidt
69b1fdcd60
Propose kotlinx.serialization as 3rd party lib
Has support for protobuf v2.
2018-01-30 13:58:56 +01:00
Jisi Liu
25a90e82ff
Merge pull request from ras0219-msft/patch-1
Add Vcpkg to C++ installation instructions for Windows
2018-01-29 19:29:55 -08:00
Robert Schumacher
aaf41c600d Add Vcpkg to C++ installation instructions for Windows
Fixes issue  by noting that `vcpkg` contains protobuf. Potential improvements: also remark how to use `vcpkg` to get dependencies when building from source via CMake.
2018-01-29 17:29:54 -08:00
Adam Cozzette
1681fe664b
Merge pull request from mathstuf/cmake-private-target-sources
cmake: privately add sources to targets
2018-01-29 16:40:36 -08:00
Feng Xiao
f438ebd805
Merge pull request from davido/generate_warning_free_java_code
Java: Generate warning free code
2018-01-29 16:21:50 -08:00
Adam Cozzette
da6b07a2e5
Merge pull request from acozzette/using-statements
Removed using statements from common.h
2018-01-29 11:34:39 -08:00
David Ostrovsky
86fdad0fb5 Java: Generate warning free code
Partially fixes .
2018-01-27 15:18:20 +01:00
Adam Cozzette
39a789e657 Removed using statements from common.h
These statements pulled a bunch of symbols from the std namespace into
the global namespace. This commit removes all of them except for
std::string, which is a bit trickier to remove.
2018-01-26 16:17:14 -08:00
Feng Xiao
c236896ec5
Merge pull request from leighmcculloch/patch-1
Remove broken link to code.google.com/p/protorpc
2018-01-26 11:11:40 -08:00
Leigh McCulloch
4a3b42ed05
Remove broken link to code.google.com/p/protorpc
Remove broken link to RPC implementation https://code.google.com/p/protorpc/. Going to this URL displays a 404 error message, with no indication that the project has a new location or still exists.
2018-01-25 22:27:19 -08:00
Feng Xiao
ed14fe423b
Merge pull request from xfxyjwf/builtsources
Remove the use of BUILT_SOURCES
2018-01-25 15:37:00 -08:00
Jon Skeet
0c52335587 Update .NET SDK to 2.0.3
This will allow SourceLink as per , and mean that we can use C#
7.0 language features in the library (but not in generated code).
This does not affect which platforms we're *targeting*, so end users
won't see any difference.

It would be nice to update to 2.1.4, but AppVeyor's "Visual Studio
2017" environment is only 2.0.3.
2018-01-25 19:42:15 +00:00
Feng Xiao
94f3be06ba
Merge pull request from themattchan/patch-1
Add Haskell implementations
2018-01-25 10:49:33 -08:00
Thomas Van Lenten
3e1587fd4b Add an explicit import of stdatomic.h.
The generated code for enums needs atomics support, so generate the
import instead of relying on it via transitive imports. This will
make future changes to this likely likely to break generated code
and runtime support are mixed.

Followup to https://github.com/google/protobuf/pull/4184.
2018-01-25 12:18:39 -05:00
Thomas Van Lenten
6fd2ae7e45 Bring back import of OSAtomic.
Followup to https://github.com/google/protobuf/pull/4184, keep the
import to not break any existing generated code that isn't regenerated
when they update to the newer protobuf code.
2018-01-25 12:18:39 -05:00
Matt Chan
72337d6cc9
Add Haskell implementations
Add Awake Security's Haskell Protobuf and GRPC implementations
2018-01-24 23:52:04 -08:00
Feng Xiao
1d02e45468
Merge pull request from davido/drop_java_6_support
Drop java 6 support
2018-01-24 23:41:32 -08:00
David Ostrovsky
019ceea4b3 Drop java 6 support
Fixes .
2018-01-25 06:54:38 +01:00
Feng Xiao
c337d9f929 Remove the use of BUILT_SOURCES
Fixes https://github.com/google/protobuf/issues/3912

[BUILT_SOURCES](https://www.gnu.org/software/automake/manual/html_node/Sources.html)
is used with [Automake's automatic dependency tracking](https://www.gnu.org/software/automake/manual/html_node/Dependencies.html#Dependencies)
but doesn't work well in protobuf when cross-compiling. Their presence
causes maek to always generate them even when they are not requested
and as a result causes cross-compilation to fail because the built protoc
cannot be used to generate unittest protos (see: https://github.com/google/protobuf/issues/3912).

Removing it with explicit dependencies fixes the build issue when running
'make', 'make all', 'make install' at cross-compilation. It doesn't affect
'make protoc' because BUILT_SOURCES only works for the implicit targets
'all', 'check' or 'install'.
2018-01-24 17:20:01 -08:00
Ludger Sprenker
9ab859f5a5
Create std::string in Arena memory 2018-01-24 17:14:05 +01:00
Feng Xiao
80e016e838
Merge pull request from xuwei-k/patch-2
fix typo in FieldMaskTree.java comment
2018-01-23 16:06:13 -08:00
Jonathan Dierksen
a721bf6d29 Migrate away from deprecated OSAtomic APIs. ()
* Migrate away from deprecated OSAtomic APIs.
2018-01-22 16:26:39 -05:00