Commit graph

808 commits

Author SHA1 Message Date
Jon Skeet
b1ea15f7a5 Make sure that
"valueField": null

is parsed appropriately, i.e. that it remembers that the field is set.
2016-01-15 14:18:16 +00:00
Jon Skeet
9e4f354f14 Prohibit null values in map fields
On deserialization, missing values for message types
are replaced with a "default" message.
2016-01-11 09:34:43 +00:00
Feng Xiao
8f2b622944 Fix appveyor build. 2016-01-09 00:48:49 -08:00
Feng Xiao
76195058e2 Patch internal change 111557819.
Defer calls to mutable_unknown_fields() until it is actually required to
save memory for C++ lite runtime.

Change-Id: Ica9c1fd276cdb164942d1e7b6e098c83ee3ffdc5
2016-01-06 18:10:24 -08:00
Feng Xiao
17347e3d0d Fix for Visual Studio 2008. 2015-12-30 01:18:22 -08:00
Feng Xiao
c5147e3d51 Fix a misplaced macro.
Change-Id: Ife609e073bd142d328b680c753f543bb18f4f66d
2015-12-28 16:40:39 -08:00
Feng Xiao
7a9d5825e2 Fix a compiler warning.
Change-Id: I4c4e2a4a248e4336fef735f75ff5648d8d33627e
2015-12-28 16:30:59 -08:00
Feng Xiao
b7610f129d Add missing files to EXTRA_DIST.
Also delete some unused files.
2015-12-28 14:18:49 -08:00
Feng Xiao
d217808417 Merge branch master into v3.0.0-beta-2 2015-12-21 00:34:19 -08:00
Feng Xiao
b27f2893b2 Merge pull request #1062 from rinatz/master
Fix static non-pod type problem with dlopen
2015-12-18 17:36:14 -08:00
Kenichiro IDA
674e92d314 Initialize singleton instance by GoogleOnceInit() 2015-12-19 10:14:42 +09:00
Feng Xiao
a0cecfd31a Make conformance tests build for C++ and Java.
Change-Id: Ibb3fe6f919cc7ca0df91da5e1697ba33d259e433
2015-12-16 13:38:10 -08:00
Kenichiro IDA
894d18fba4 Alter FileDescriptorTables::kEmpty to GetEmptyInstance() 2015-12-17 01:46:48 +09:00
Jon Skeet
aabc6c411a Make ToString() valid without a type registry
This addresses issue #1008, by creating a JsonFormatter which is private and only different
to JsonFormatter.Default in terms of reference equality.

Other plausible designs:

- The same, but expose the diagnostic-only formatter
- Add something to settings to say "I don't have a type registry at all"
- Change the behaviour of JsonFormatter.Default (bad idea IMO, as we really *don't* want the result of this used as regular JSON to be parsed)

Note that just trying to find a separate fix to issue #933 and using that to override Any.ToString() differently wouldn't work for messages that *contain* an Any.

Generated code changes follow in the next commit.
2015-12-15 09:23:38 +00:00
Feng Xiao
85c4c36c82 Remove the usage of C++11 override.
[skip appveyor]

Change-Id: I700f70e734abb6264db29369ecf227a9e1f783e7
2015-12-14 14:49:44 -08:00
Feng Xiao
e841bac4fc Down-integrate from internal code base. 2015-12-11 17:10:28 -08:00
Feng Xiao
9cbf40873d Merge pull request #1025 from Yangqing/master
Arena type traits standardization.
2015-12-09 16:58:18 -08:00
Yangqing Jia
031558bd36 Minor changes to match the internal version 2015-12-09 15:25:02 -08:00
Feng Xiao
723010dc54 Merge pull request #1033 from c0nk/wip-implicit-cast-fix
Fix narrowing implicit cast in generated message [NFC]
2015-12-09 13:40:38 -08:00
Kal Conley
f42a68df54 Fix narrowing implicit cast in generated message [NFC] 2015-12-08 23:12:06 -08:00
Bo Yang
1f0286a404 Use angle bracket for well known type proto header. 2015-12-08 14:43:45 -08:00
Yangqing Jia
bbf64cee3d Arena type traits standardization.
This is adapted from the branch of @xfxyjwf at:

494716a682

and should solve the protobuf compilation problem against nvcc.

Tested against nvcc 6.5 and 7.0.
2015-12-05 18:36:18 -08:00
Thomas Van Lenten
536059e569 Tweak the error message as the generate is in the core binary these days. 2015-12-02 14:43:29 -05:00
Kal Conley
a52539a32d Fix some narrowing implicit casts [NFC] 2015-11-28 20:22:25 -08:00
Craig Donner
8e869f7627 Adds support for buliding protobuf with emscripten; we just needed the proper platform define used in the right place. 2015-11-24 15:07:18 -08:00
Jon Skeet
72ec33676f Tidy up reflection in advance of attempting to implement DynamicMessage.
There are corner cases where MessageDescriptor.{ClrType,Parser} will return null, and these are now documented. However, normally they *should* be implemented, even for descriptors of for dynamic messages. Ditto FieldDescriptor.Accessor.
We'll still need a fair amount of work to implement dynamic messages, but this change means that the public API will be remain intact.

Additionally, this change starts making use of C# 6 features in the files that it touches. This is far from exhaustive, and later PRs will have more.

Generated code changes coming in the next commit.
2015-11-22 16:25:44 +00:00
Jon Skeet
a6361a124a Rename "umbrella" to "reflection" consistently.
This changes csharp_names.h, which will require a corresponding change in GRPC.
2015-11-19 13:05:17 +00:00
Jon Skeet
2a15051a1e Introduce a Parser property into MessageDescriptor, and populate it from generated types.
Generated code coming in next commit - in a subsequent PR I want to do a bit of renaming and redocumenting around this, in anticipation of DynamicMessage.
2015-11-19 08:50:28 +00:00
Jon Skeet
c581acb562 Merge pull request #944 from jskeet/umbrella-classname
Change the way the "umbrella class" (descriptors) is named/namespaced
2015-11-19 08:48:50 +00:00
Thomas Van Lenten
2a91c64f49 Reorder the checks so anything in the expected file is an implicit whitelisting.
In the old flow, any 2 char prefix in the expected file was still generating a
warning about being a poor prefix. Now we check the expected file first, so
anything expected is let through.
2015-11-17 16:48:59 -05:00
Jon Skeet
61a50b9e6b Change how the reflection descriptor class is generated.
Instead of having a Proto nested namespace to avoid conflicts between the descriptor-holding static class and message classes, just append "Reflection" to the name.
Generated code changes (and corresponding manual changes) in following commit.
2015-11-09 09:22:43 +00:00
Jon Skeet
f4f601bd47 Stop removing all blank lines in doc comments.
This fixes issue #832.

Generated code changes in next commit.
2015-11-06 18:38:16 +00:00
Doug Kwan
2a50e67c78 Add support for POWER Linux 2015-11-03 14:49:42 -08:00
Feng Xiao
9659ea9e56 Fix compilation errors when built internally.
1. mathlimits.h must be included before the inclusion of cmath (which
     gtest/gtest.h seems to include).
  2. hash function for StringPiece doesn't work.

Change-Id: I358a25d941a25b10b39fe76780eda41557699811
2015-11-02 12:39:27 -08:00
Benjamin Barenblat
a2ce9cb9ea Correct spelling 2015-10-30 14:05:24 -04:00
Bruce Dawson
86ba70ec41 Get VS 2015 to use const int definitions
VC++ up to VS 2015 RTM does not require explicit storage allocation for
static const integers declared in classes. VS 2015 Update 1 requires
these storage definitions in some cases. It's unclear exactly what
cases - simple tests work with and without the explicit storage
allocation.

Many previous versions of VC++ have theoretically *allowed* a
definition to supply storage, but tests on VC++ 2013 show that this
doesn't actually work correctly - it leads to duplicate definition
errors in Chromium. So, the change is scoped to VS 2015 only.

This change also updates the generated files to match the new generator.

TL;DR - this change is necessary in order for Chromium to build with
VS 2015 Update 1.
2015-10-29 13:04:18 -07:00
Jan Tattermusch
d4569d1f5e Merge pull request #908 from jskeet/oneof-equality
Use oneof case in equality tests
2015-10-24 11:41:00 -07:00
Jon Skeet
964627ece0 Include the oneof-case in equality and hash code generated code.
The included C# test will fail until the regenerated code is used, which is in the next commit.
2015-10-24 06:45:20 +01:00
Matthew Wu
187cfc5700 Change the #include for any.h to use angle brackets instead of quotes, to be consistent with other protobuf library includes. 2015-10-22 16:09:56 -07:00
Feng Xiao
5314ad1b21 Merge pull request #783 from podsvirov/topic-cmake-project
Improved CMake project
2015-10-16 14:08:38 -07:00
Jan Tattermusch
d8a926ebf2 Merge pull request #824 from jtattermusch/expose_get_output_file
Expose GetOutputFile in csharp_names.h
2015-10-14 07:40:36 -07:00
Feng Xiao
8894d1febf Merge pull request #875 from tkarls/return_correct_bool_type_from_map
Changed return type from int32 to bool in function returning a bool
2015-10-13 16:52:50 -07:00
Thomas Karlsson
59906e81d8 Changed argument typ to uint32 in set function that sets an uint32 value 2015-10-13 13:35:07 +02:00
Thomas Karlsson
b7996f0929 Changed return type from int32 to bool in function returning a bool 2015-10-13 13:20:32 +02:00
Paul Yang
49f24afb45 Merge pull request #815 from TeBoring/third-party
Use std::get where it's available
2015-10-09 12:38:31 -07:00
Hamdi Sahloul
4ead55c370 Use static cast
Used static cast to improve initalization compatibility with MSVC2010
2015-10-09 05:10:30 +09:00
Hamdi Sahloul
4c4aae87d5 VS2010 compatibility of address initalization
VS2010 cannot compile json_util_test.cc since it assumes NULL as a zero (int), and therefore cannot convert into to char*
2015-10-09 00:21:26 +09:00
Jisi Liu
5f6a1d3dbb Remove duplicated header file 2015-10-06 13:58:41 -07:00
Jisi Liu
61871a02d4 fix stringpiece test to use portable hash set. 2015-10-05 15:05:50 -07:00
Jisi Liu
e8c3c54b3f Adding back three missing export macros. 2015-10-05 14:39:10 -07:00