Commit Graph

730 Commits

Author SHA1 Message Date
Feng Xiao
54a4cccb97 Merge pull request #481 from Qartar/master
Workaround for MSVC's string literal compiler limit.
2015-06-12 14:56:02 -07:00
Qartar
2fe6d7bc57 Workaround for MSVC's string literal compiler limit.
Escape characters don't count for string literal size, no need to pre-generate escape string.

Added unit test to touch enormous cpp generated descriptor.

Updated makefile to include enormous_descriptor.proto

Fixed language compatibility error.
2015-06-12 13:23:09 -07:00
Jon Skeet
a8dae140c6 Fix oneof generator - forgot to provide variables... 2015-06-12 13:11:16 +01:00
Jon Skeet
5a33827eec Move Count checks into the serialization code
I wouldn't expect this to affect anything, but it appears to.
2015-06-12 11:52:14 +01:00
Tamir Duberstein
66463d7e4b Give descriptor.proto a go package
This is currently done in golang/protobuf using `sed`. This change
should simplify things.
2015-06-12 06:40:18 -04:00
Jon Skeet
1b71db1180 Optimization of CalculateSize: avoid foreach over empty lists. 2015-06-12 11:19:50 +01:00
Jon Skeet
4352744859 Use Length to check string/bytes fields for emptiness - it's faster than an equality check. 2015-06-12 11:18:37 +01:00
Jon Skeet
8fcde2cabd Fix oneof behaviour in the face of default values. 2015-06-12 11:17:07 +01:00
Jon Skeet
96ddf01aed Coded*Stream streamlining.
Remove ICodedInputStream and ICodedOutputStream, and rewrite CodedInputStream and CodedOutputStream to be specific to the binary format. If we want to support text-based formats, that can be a whole different serialization mechanism.
2015-06-12 09:53:12 +01:00
Jon Skeet
39aaf21d51 Reimplement enums as int values, and get rid of EnumHelper.
This makes repeated fields really awkward at the moment - but when we reimplement RepeatedField<T> to be backed by an array, we can cast the array directly...
2015-06-11 21:15:36 +01:00
Austin Schuh
1ecef1a2f5 Modified FindRubyTestDir to use GOOGLE_THIRD_PARTY_PROTOBUF 2015-06-10 23:33:07 -07:00
Paul Yang
fb466c13a7 Merge pull request #480 from thomasvl/objc_beta_drop
Beta quality drop of Objective C Support.
2015-06-09 17:17:45 -07:00
Jon Skeet
e38294a62d First pass at the mutable API. Quite a bit more to do - in particular, it's pretty slow right now. 2015-06-09 19:30:44 +01:00
Austin Schuh
fd73235f6b Refactored threadlocal logic.
Refactored the threadlocal logic for Android and IOS into logic in
platform_macro.h which computes a GOOGLE_PROTOBUF_NO_THREADLOCAL
define which is then used elsewhere.  This allows new platforms
without THREADLOCAL to be easily defined.
2015-06-08 18:49:16 -07:00
Thomas Van Lenten
d846b0b059 Beta quality drop of Objective C Support.
- Add more to the ObjC dir readme.
- Merge the ExtensionField and ExtensionDescriptor to reduce overhead.
- Fix an initialization race.
- Clean up the Xcode schemes.
- Remove the class/enum filter.
- Remove some forced inline that were bloating things without proof of performance wins.
- Rename some internal types to avoid conflicts with the well know types protos.
- Drop the use of ApplyFunctions to the compiler/optimizer can do what it wants.
- Better document some possible future improvements.
- Add missing support for parsing repeated primitive fields in packed or unpacked forms.
- Improve -hash.
- Add *Count for repeated and map<> fields to avoid auto create when checking for them being set.
2015-06-08 17:17:22 -04:00
Feng Xiao
b9baa47eaf Merge pull request #468 from AustinSchuh/unsigned_proto
Marked another compiler literal unsigned.
2015-06-06 00:40:51 -07:00
Austin Schuh
307af628e6 Marked another compiler literal unsigned.
When compiling a protobuf with gcc 4.1.2 for powerpc, I ran into
another of the following warning message:

INFO: From Compiling my_proto.pb.cc powerpc-603e-linux-gcc:
bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc: In member
   function `virtual void MyProto::Clear()':
   bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc:223: warning: this
      decimal constant is unsigned only in ISO C90

The line in the proto file that was triggering it was:

  if (_has_bits_[24 / 32] & 4278190080) {
    ZR_(field1_, field2_);
  }

_has_bits_ is a uint32.  The constant mask should therefore be
unsigned.  This change updates the constant to be generated as
unsigned.
2015-06-05 22:46:01 -07:00
Austin Schuh
f4c8627edb Fixed bug in GOOGLE_PREDICT_FALSE.
The GOOGLE_PREDICT_FALSE macro is both incorrect, and doesn't match
the macro definition in glog, which causes conflicts when including
both libraries.  This commit fixes that by making it identical to
what is in glog.
2015-06-05 18:49:25 -07:00
Jon Skeet
f52426827e First stab at new proto3-only code generator 2015-06-05 20:44:05 +01:00
Jie Luo
8fe039a69a Merge pull request #462 from anandolee/master
Migrate writer to printer for C#
2015-06-04 16:15:23 -07:00
Feng Xiao
42f109d7bc Merge pull request #457 from xfxyjwf/cmake
Add cmake support.
2015-06-04 13:35:45 -07:00
Jie Luo
90da3514cd Migrate writer to io::Printer for C# 2015-06-04 11:39:13 -07:00
Feng Xiao
96f1d4ada2 Merge pull request #453 from bakineggs/master
Add protoc path detection for Mac OS
2015-06-03 11:20:08 -07:00
Feng Xiao
37df4b65a4 Delete default UnknownFieldSet when shuting down. 2015-06-02 22:26:00 -07:00
Feng Xiao
dbcfc5e202 Merge pull request #444 from xfxyjwf/vs2010_fix
Fix two issues on vs2010.
2015-06-02 21:32:41 -07:00
Dan Barry
0af3ed5189 Add protoc path detection for Mac OS 2015-06-02 17:11:35 -07:00
Feng Xiao
69433f3810 Merge pull request #305 from ezegomez/master
Fix unittest in i386
2015-06-02 10:53:03 -07:00
Jan Tattermusch
ad174e0391 Merge pull request #441 from anandolee/master
Change the C# enum generator inherit from primitive generator
2015-06-01 12:31:18 -07:00
Feng Xiao
4333edb340 Add cmake support. 2015-05-31 02:28:34 -07:00
Feng Xiao
93d6838ab5 Call copy() only if there is something to copy.
RepeatedField::begin()/end() will return NULL when the content is empty.
Passing these NULL values to std::copy() will result in runtime complains
from some compilers (e.g., vs2010).
2015-05-31 00:15:55 -07:00
Feng Xiao
5a9be2c6f6 Fix MapAllocator::destroy() bug.
destroy() should always call the destructor because the caller may rely on
the destructor to do clean-ups.
2015-05-31 00:14:23 -07:00
Jie Luo
a21a2cf7d3 Change the C# enum generator inherit from primitive generator 2015-05-29 18:07:18 -07:00
Jie Luo
802e1848ad Merge pull request #404 from anandolee/master
Add oneof support for c#
2015-05-29 17:19:46 -07:00
Jie Luo
f7b417ddfe Add oneof support for C# 2015-05-29 13:29:30 -07:00
unknown
ca1c252923 Fixes on visual studio 2008 2015-05-27 17:33:10 -07:00
Feng Xiao
b11d6fe515 Replace "\\" with "/" for windows path names. 2015-05-26 21:33:46 -07:00
TeBoring
9250fbaead In std11, on mac, operator new doesn't take right reference. 2015-05-26 15:50:06 -07:00
Paul Yang
850fe8bfc6 Merge pull request #430 from xfxyjwf/std11_fix
Make MapAllocator work with C++11.
2015-05-26 14:38:10 -07:00
Feng Xiao
bdd105d978 Make MapAllocator work with C++11.
Change-Id: I0e1d9e248403631cb57ebed5231e85d19b9bb3df
2015-05-26 14:34:53 -07:00
Paul Yang
1b540d5729 Merge pull request #429 from xfxyjwf/std11_fix
Remove std::is_trivially_default_constructible.
2015-05-26 14:24:59 -07:00
Bo Yang
83d334f713 When doing make distcheck, a src/google/protobuf/compiler/ruby is created to
put built libraries. This directory hides the one that contains
ruby_generated_code.proto and ruby_generated_code.rb.
2015-05-26 14:13:53 -07:00
Feng Xiao
da0afba8f8 Remove std::is_trivially_default_constructible.
This type_traits is only added after g++ 5.1.0 but we need to support g++ 4+.
2015-05-26 13:54:47 -07:00
Bo Yang
3a5455b34b uint64 has non-trivial destructor on 32-bit windows. This cause arena
allocator to allocate memory twice for uint64.
2015-05-26 13:12:16 -07:00
Jorge Canizales
0d3b36ad54 Adds objectivec_helpers.h to the headers installed by make. 2015-05-26 10:46:09 -07:00
Feng Xiao
4e0c46f93d Explicitly call destructor of Mutex to release resources.
Change-Id: I808f4a3689e723d4490aa9ba6f1c14e3936ddcec
2015-05-25 19:04:00 -07:00
Feng Xiao
72f17c4367 Make hash_map forward constructor parameters to its base class.
We use a custom allocator for map fields and this allocator must be
passed correctly to hash_map to make sure it's allocated properly
with our custom allocator.

Change-Id: Ie59fa24bf11ff28ffd0fa870e24e456c66b2b9c5
2015-05-25 18:18:29 -07:00
Bo Yang
a9332e201d Copy two data files from ruby/tests to src/google/compiler/ruby. Tests in src/google/compiler/ruby depend on these two files, but they were missed in language distributions other than ruby 2015-05-25 16:04:36 -07:00
Bo Yang
cf603a9dfa Fix bugs on windows. 2015-05-24 23:03:05 -07:00
Bo Yang
f87e5b7e74 Fix C2385: accessing parent classes' member without specifying is ambiguous. 2015-05-24 00:13:26 -07:00
Feng Xiao
55df12194f Merge pull request #341 from yukawa/fix-undef-GOOGLE_PROTOBUF_MISSING_HASH
Undef GOOGLE_PROTOBUF_MISSING_HASH after it is used.
2015-05-22 15:56:34 -07:00
Paul Yang
48f95941bc Merge pull request #410 from thomasvl/objc_alpha2_drop
Objective C Second Alpha Drop
2015-05-22 14:12:15 -07:00
Thomas Van Lenten
1dcc329427 Objective C Second Alpha Drop
- Style fixups in the code.
- map<> serialization fixes and more tests.
- Autocreation of map<> fields (to match repeated fields).
- @@protoc_insertion_point(global_scope|imports).
- Fixup proto2 syntax extension support.
- Move all startup code to +initialize so it happen on class usage and not app startup.
- Have generated headers use forward declarations and move imports into generated code, reduces what is need at compile time to speed up compiled and avoid pointless rippling of rebuilds.
2015-05-22 14:27:31 -04:00
Paul Yang
d94e65afda Merge pull request #413 from TeBoring/master
down-integrate internal changes
2015-05-21 20:11:26 -07:00
Bo Yang
5db217305f down-integrate internal changes 2015-05-21 19:32:02 -07:00
Paul Yang
e1000189bf Merge pull request #411 from xfxyjwf/master
Add default import paths for descriptor.proto and well-known protos.
2015-05-21 18:45:23 -07:00
Feng Xiao
1aacb4fbbf Include well-known types in Java runtime.
Change-Id: I816fe2fac7fccbcd96dd8510c7c9b5e7996aeadc
2015-05-21 17:28:05 -07:00
Feng Xiao
e9abc404df Add default import paths for descriptor.proto and other well-known types to protoc.
Change-Id: I4afa295de4c8ed2a4cd0919cf84aedcd1327d9a5
2015-05-21 16:45:47 -07:00
Paul Yang
c3480926f9 Merge pull request #402 from thomasvl/objc_on_win
Getting the ObjC generator building on Windows.
2015-05-21 11:20:15 -07:00
Austin Schuh
e826837f7e Marked compiler literal unsigned.
When compiling a protobuf with gcc 3.3.2 for powerpc, I ran into the
following warning message:

INFO: From Compiling my_proto.pb.cc powerpc-603e-linux-gcc:
bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc: In member
   function `virtual void MyProto::Clear()':
   bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc:223: warning: this
      decimal constant is unsigned only in ISO C90

The line in the proto file that was triggering it was:

  if (_has_bits_[24 / 32] & 4278190080) {
    ZR_(field1_, field2_);
  }

_has_bits_ is a uint32.  The constant mask should therefore be
unsigned.  This change updates the constant to be generated as
unsigned.
2015-05-19 23:22:20 -07:00
Thomas Van Lenten
ce55ff9441 Getting the ObjC generator building on Windows.
Remove the ClassList support (maybe bring it back in the future).
Trim the includes to hopefully get a working Window build.
Add some more returns after switches for compilers that warn even when all values of the enum are handled.
Use ghtonl instead of htonl.
Change the use of [u]int(8,32)_t within the ObjC generator code to [u]int(8,32) to match the rest of the compiler.
Add objective-c generator files to Visual Studio project.
2015-05-19 20:25:19 -04:00
Thomas Van Lenten
ffa2e377f3 Post csharp landing fixup.
Re-add the objc prefix that got removed by accident.
Regenerate the generated descriptors (C++ and ObjC).
2015-05-18 12:57:33 -04:00
Jie Luo
aa8c951ef5 Merge pull request #384 from google/csharp
Merge protobuf C# into master (only C# proto2 is supported)
2015-05-14 14:54:36 -07:00
Jan Tattermusch
4111310830 Merge branch 'master' of github.com:google/protobuf into integrate_from_master 2015-05-13 13:35:02 -07:00
Jon Skeet
998b5ba20d Remove the C#-specific field_presence_test.proto, using unittest_no_field_presence.proto instead.
This is the start of establishing a C# namespace of "Google.ProtocolBuffers.TestProtos.Proto3" for proto3-syntax protos.
We could optionally split the directory structure as well into Proto2 and Proto3 for clarity.
2015-05-13 17:34:02 +01:00
Feng Xiao
33c92803d5 Include generated code of well-known types in protobuf C++ runtime.
Change-Id: I23dee1c1d27b6440658680e9c273b6250213123c
2015-05-11 13:47:41 -07:00
Feng Xiao
de5d45500c Merge branch 'gerrit' to 'master' 2015-05-07 14:07:30 -07:00
Feng Xiao
03e170446b Merge pull request #101 from fizbin/fix_large_proto_java_code
Fix java compilation issues when processing large .proto files
2015-05-07 10:28:52 -07:00
Jon Skeet
8172561995 Regenerate descriptor.pb.cc after csharp_namespace change 2015-05-07 09:14:00 +01:00
Paul Yang
b89de5f6e0 Merge pull request #331 from thomasvl/objc_alpha1_drop
Objective C compiler plugin and runtime
2015-05-06 17:32:07 -07:00
Tamir Duberstein
9d9d0b70de Don't hard-code the python path 2015-05-06 17:02:57 -04:00
Jon Skeet
7879f82ddc Add C# namespace to .proto files (e.g. descriptors, unit tests) 2015-05-06 19:07:14 +01:00
Thomas Van Lenten
30650d81d9 Alpha 1 drop of Google's Objective C plugin and runtime support for protobufs. 2015-05-06 13:19:14 -04:00
Yohei Yukawa
cf9f603e8d Undef GOOGLE_PROTOBUF_MISSING_HASH after it is used.
This is a follow up CL for df184fba00
(Id937e25bbb35968ee76c92bd4a8ce6247408c443), which added
  #undef GOOGLE_PROTOBUF_MISSING_HASH
where GOOGLE_PROTOBUF_MISSING_HASH macro is never defined.

With this CL, GOOGLE_PROTOBUF_MISSING_HASH macro will be cleaned up
after it is used.
2015-05-04 01:25:52 -07:00
Jie Luo
d9e3063eb0 Remove ClsCompliant declarations from C# code 2015-05-01 14:08:23 -07:00
Jisi Liu
0e122ce8c5 Merge pull request #315 from brianduff/sync_from_aosp
Sync nanoproto from AOSP
2015-04-29 10:44:35 -07:00
Jeff Davidson
9d546c85bd Generate a CREATOR for each Parcelable message.
This is less ideal from a dex count perspective because it requires a
new variable for each message, and because most apps have proguard
rules that will ensure that CREATOR classes are retained.

However, it is required to be able to use nano protos inside of AIDL
files, as the autogenerated AIDL code fails to compile otherwise. This
is a substantial benefit as it allows for backwards-compatible
parameters and return types in AIDL methods along the lines of
safeparcel.

Bug: 19084705
Change-Id: I66a2c0424b96cf8ff6b631b186cc4f9407dfc1f4
2015-04-28 13:12:37 -07:00
Brian Duff
a69b461e1e Inline unknownFieldData{Equals,HashCode} to generated code.
It turns out dex (apparently) was inlining these protected final
methods from ExtendableMessageNano into every message class. Removing
these methods from the base class and inlining their code reduces
the method count by 2 methods / message when the store_unknown_fields
option is on.

Change-Id: I0aa09f2016d39939c4c8b8219601793b8fab301f
2015-04-28 13:02:33 -07:00
Brian Duff
dac7e02d2b Expose generate_clear as an option.
I wasn't able to get the clear() method to inline into the
constructor when optimizations are on in proguard. As a result,
every message has an extra superfluous kept method assuming the
app never uses clear() directly.

There are a couple of instances where setting this option false is
necessary in order to get code dexing successfully without hitting
the method limit, e.g. https://goto.google.com/tltzq

In this example, I tried turning on the method/inlining/unique and
method/inlining/short optimizations before resorting to adding the
generate_clear option, but the method count did not decrease. The
clear() methods were contributing over a thousand extra methods.

Change-Id: If6a9651d6a59cdf70b1040d8248779710ac73105
2015-04-28 13:01:48 -07:00
Jeff Davidson
ec19be2f3c Generate @IntDef annotations for nanoproto enums.
@IntDef is a support library annotation which allows build tools to
determine the valid set of values for a given integer field when that
field is intended to be restricted like an enum. This avoids the
overhead of enums while still allowing for compile-time type checking
in most circumstances.

Change-Id: Iee02e0b49a8e069f6456572f538e0a0d301fdfd5
2015-04-28 13:01:12 -07:00
Brian Duff
d099a88685 Add clone() method support for nano.
Upstreamed from Another Place (cr/57247854).

Change-Id: I2aaf59544c0f5ae21a51891d8a5eeda1dc722c90
2015-04-28 12:42:55 -07:00
Brian Duff
fb96026b8d When no clear() is generated, still initialize fields.
https://android-review.googlesource.com/#/c/67890/ removed field
initialization from the ctor, making it just call clear() instead.

When I added the generate_clear option back (as part of the reftypes
compat mode) in https://android-review.googlesource.com/#/c/109530/,
I forgot to ensure that what clear() used to do was inlined in the
constructor.

This change fixes NPEs that are happening for users of
reftypes_compat_mode who rely on unset repeated fields being empty
arrays rather than null.

Change-Id: Idb58746c60f4a4054b7ebb5c3b0e76b16ff88184
2015-04-28 12:28:05 -07:00
Brian Duff
ec2f244554 Fix bug with large extension field numbers.
Previously, extensions with field numbers greater than 268435455 would
result in a compile time error in generated code that looks something
like this:

Foo.java:3178: error: integer number too large: 3346754610
                3346754610);

This is because we were trying to represent the tag number (an
unsigned int) using a java int constant, but java int constants are
signed, and can't exceed Integer.MAX_VALUE.

Fixed by declaring it as a long instead, and casting it down to an
int in the implementation. This is safe, because the tag value always
fits in 32 bis.

Change-Id: If2017bacb4e20af667eaeaf9b65ddc2c30a7709f
2015-04-28 11:42:01 -07:00
Bo Yang
46bd60b92f Modify directory to use in test
Change-Id: Iede1dc4e70427663e0d3c5304fa86b3aebf492b7
2015-04-27 17:44:45 -07:00
Bo Yang
9a12185323 Handle un-handled cases of TestOneof2 in unittest
Change-Id: I8f082ee3117ed873ab472a539867ff7cae58e8fd
2015-04-27 14:47:04 -07:00
Jie Luo
5a811ac6f9 fix bug for Field Presence 2015-04-27 14:27:21 -07:00
Jie Luo
856ced5d76 Field Presence: remove has methods for optional non-message fields in proto3 2015-04-27 14:00:47 -07:00
Ezequiel Lara Gomez
fb28d73204 Fix unittest in i386 2015-04-27 09:35:27 +01:00
Bo Yang
d6c9f644ac internal changes
Change-Id: I66f216c70a19f44637090878d7e442d4d0f8991b
2015-04-24 18:09:55 -07:00
Feng Xiao
7ddbf87008 Include well-known type protos in "make install". 2015-04-23 20:23:58 -07:00
Feng Xiao
ca9d1a053a Include all well-known type protos.
Change-Id: I122f1cee71a8a739ea603e52582cb0fa9698f0ed
2015-04-20 11:30:31 -07:00
Jie Luo
7646eec9ce Merge pull request #288 from jtattermusch/csharp_protobuf_reviewed
C# protocol buffers (initial pull request)
2015-04-17 17:29:39 -07:00
Jan Tattermusch
7eaf438031 forgot to include header files into automake template 2015-04-17 16:51:43 -07:00
Jan Tattermusch
8e190d498c temporarily removing csharp_umbrella_namespace file option 2015-04-17 11:07:02 -07:00
Jan Tattermusch
83a5991d12 removing csharp_property_name field option 2015-04-17 10:53:06 -07:00
Jan Tattermusch
b36420addb one more fix to csharp_umbrella_namespace comment 2015-04-17 10:20:35 -07:00
Jan Tattermusch
b6555b1da0 fix: do not mention umbrella_classname in comment 2015-04-17 10:00:38 -07:00
Jan Tattermusch
abcde243fe Fixed comment for csharp_umbrella_namespace (nest_classes has been removed) 2015-04-16 15:32:36 -07:00
Jan Tattermusch
2c2f76c50f fixing field number of csharp_umbrella_namespace option 2015-04-16 15:28:32 -07:00
Jan Tattermusch
333d200a96 integrate CalcSerializedSize() fix from protobuf-csharp-port issue 84 2015-04-13 17:41:03 -07:00
Jan Tattermusch
7cc05ecb3a fixing implementation of GetFileUmbrellaNamespace 2015-04-13 16:32:54 -07:00
Jan Tattermusch
5ac8de5b46 implemented HasRequiredFields logic 2015-04-13 16:12:29 -07:00
Jan Tattermusch
db9060dc61 addressed TODO for lite runtime 2015-04-13 15:48:40 -07:00
Jan Tattermusch
d92de1742d creating private ctor for builders is now the default (as it used to be for old codegen) 2015-04-13 15:28:43 -07:00
Jan Tattermusch
f61e1791c0 output file naming logic, configurable file extension, comment rewording 2015-04-13 15:10:07 -07:00
Jan Tattermusch
8cec65e761 added support for deprecated fields, reworded some todos 2015-04-13 14:21:33 -07:00
Jan Tattermusch
16a3e2b914 enable overriding of property name using csharp_property_name 2015-04-13 13:03:23 -07:00
Jan Tattermusch
44664bb705 updated C# codegen to use restricted set of csharp options from descriptor.proto 2015-04-13 12:40:48 -07:00
Jan Tattermusch
b52cf04b3c restricted number of csharp options and regenerated descriptor.proto 2015-04-13 10:59:24 -07:00
Tamir Duberstein
9f42f5f4a4 [PYTHON] Drop dependency on 'google.apputils'.
Use stdlib's 'unittest' instead.
2015-04-10 19:43:51 -04:00
Daniel Martin
0f1393d66e More 'int' return value documentation 2015-04-09 12:20:55 -04:00
Daniel Martin
153a226a2a CR feedback: spacing, document return values 2015-04-08 09:53:26 -04:00
Tamir Duberstein
53bee665f8 Change fixture name to be consistent
This fixes the problem where `make check` generates files not ignored
by `.gitignore`.
2015-03-31 10:21:49 -07:00
Kenton Varda
60df829ae4 Delete "SEBS" (aka: Clean up Kenton's old trash)
The file `SEBS` is a build file for a toy build system I was writing in my spare time six years ago, back when I maintained protobufs. Arguably it was never appropriate for me to have placed this file in the protobuf tree, but it was convenient at the time and didn't seem to hurt anything. It clearly doesn't belong here now, though.
2015-03-26 17:13:15 -07:00
Jan Tattermusch
685ae36ca2 Rewrote C# protogen to C++ (initial version) 2015-03-26 15:16:21 -07:00
Tamir Duberstein
ed715048c6 Add OS X to travis; fix tests to pass on OS X 2015-03-18 00:43:34 -07:00
Jisi Liu
813d6d652d Merge pull request #228 from cconroy/sanitize-enums
Sanitize Enum names from collisions with reserved words.
2015-03-16 15:48:06 -07:00
Chris Conroy
0d77c824e7 Sanitize Enum names from collisions with reserved words. 2015-03-16 18:42:26 -04:00
Bo Yang
12a91417fb Revert pull request 175: Add support for the TILE-Gx processor family. 2015-03-14 14:14:26 -07:00
Feng Xiao
9d31c227a3 Add a missing proto file.
Change-Id: Ic98584616bd6ee49680273f0cdbe6d9c038ec0e9
2015-03-13 17:06:10 -07:00
Paul Yang
a5f7bb8ebb Merge pull request #193 from TeBoring/sb
Implement a feature to generate a dependency file
2015-03-09 06:49:58 +08:00
Jisi Liu
6c8a036e3e Fix tile atomicops macro.
Change-Id: I1a3acadd059f87c26a2e26f3b7a169c0780e981e
2015-03-05 16:25:30 -08:00
Jisi Liu
0ddbafab2a Merge pull request #175 from martiert/tile-support
Add support for the TILE-Gx processor family.
2015-03-05 14:57:14 -08:00
Jisi Liu
329fa02b42 Initialize data members in constructors instead of direct initialize in
class definition, which is a C++11 extension.

Change-Id: I477fe484d737f4c60c519d68f431940ffaa33431
2015-03-01 21:34:49 -08:00
Jisi Liu
f0e8df3b66 use is_proto_enum instead of is_enum for repeated accessor field.
The later is not supported by some versions of MSVC and the former is
more accurate for the use case.

Change-Id: I7096226b1ebfef8340d288bbaf2788540aa3e97f
2015-03-01 21:18:34 -08:00
Jisi Liu
4065a31644 Fix hash.h for MSVC and platforms without hash map/set support.
Change-Id: Ic0fdb52c17b9495c73b8ce15879531383a148585
2015-03-01 21:02:22 -08:00
Jisi Liu
14fe0c99bb Fix hash_map type parameter to add Alloc for other platforms.
Change-Id: Idc5fb65a2cc469d55aff6f2cde0b51b326be0963
2015-03-01 19:51:58 -08:00
Jisi Liu
0a25cfe69d Use portable GOOGLE_PROTOBUF_THREAD_LOCAL instead of __thread.
Change-Id: Iaa75f8333541bc378bea699e7f147c7f17b652ad
2015-03-01 19:44:46 -08:00
Jisi Liu
885b612f74 Down integrate from Google internal branch for C++ and Java.
- Maps for C++ lite
- C++ Arena optimizations.
- Java Lite runtime code size optimization.

Change-Id: I7537a4357c1cb385d23f9e8aa7ffdfeefe079f13
2015-02-28 17:06:49 -08:00
Jisi Liu
7e9020fb0e Merge pull request #185 from mzhaom/remove-unused
Remove unused methods:
2015-02-26 12:46:53 -08:00
Jisi Liu
a779ae609c Merge pull request #199 from google/wkt
Add the .proto files for well-known types.
2015-02-26 10:04:37 -08:00
Jisi Liu
97dacc44af Fix the order of BUILT_FILES so that pbconfig.h will be built before
anyother targets.

Change-Id: I507009cd92a711739d7d58ccee93dfbf0a9fe135
2015-02-25 22:23:55 -08:00
Jisi Liu
a86baaa256 Exclude pbconfg.h from dist, otherwise it breaks VS builds.
Change-Id: I7f745929b137b93c122448a4a2d9a7bbab6648d6
2015-02-25 20:39:13 -08:00
Jisi Liu
f8e7a46bc2 Merge pull request #221 from google/python_proto3
Proto3 Python changes for v3.0.0-alpha-2
2015-02-25 20:35:29 -08:00
Josh Haberman
0b70a43736 Fixes for Python/C++ implementation in open-source:
* Rosy hack doesn't apply (that test should be removed
    for the open-source release).

  * Added our own copy of parameterized.py (the open-source
    version of Google Apputils doesn't contain it).

  * The C++ Descriptor object didn't implement extension_ranges.

  * Had to implement a hack around returning EncodeError, to
    work around the module-loading behavior of the test runner.
2015-02-25 20:17:32 -08:00
Jisi Liu
b67096072b Include shared_ptr.h into headers to make maps proto work. It is used
in the map_field_inl.h

Change-Id: Ieeaab5507ee34b317d76b5937beb67c298905eb4
2015-02-25 17:09:55 -08:00
Jisi Liu
ada6556785 Down integrate from Google internal.
Change-Id: I34d301133eea9c6f3a822c47d1f91e136fd33145
2015-02-25 16:39:11 -08:00
Jisi Liu
df184fba00 Make maps fields work on installed C++ protobufs.
Change-Id: Id937e25bbb35968ee76c92bd4a8ce6247408c443
2015-02-25 15:56:58 -08:00
Jisi Liu
e70329c6c0 Propogate onChange() event when getFooBuilder() is on an oneof message
field.

Change-Id: Idb5b53da5accd24038a895aba49b684eeee95814
2015-02-23 17:24:36 -08:00
Jisi Liu
7a00a1e424 Add shutdown code for several newly introduced leaks;
Disable commandline interface test for heap check tests.

Change-Id: I02aa2ad9704e3c70dcecae8b3b3557b18607d455
2015-02-21 17:45:36 -08:00
Jisi Liu
7c43f1700c Use static_cast instead of dynamic_cast in arena unittest so that it can
pass in systems without rtti.

Change-Id: Ib32b47a66f14928de9399c49dbdb07263a30d1bc
2015-02-20 16:21:04 -08:00
Jisi Liu
a6fc5da0fc Fix review comments.
Change-Id: Iafd4a3aa9d55e31478bf070311eeadfe95ece4d7
2015-02-19 17:16:26 -08:00
Jisi Liu
f2cf6cdcb2 Remove the unused set common oneof variables in helper 2015-02-19 16:43:08 -08:00
Jisi Liu
7b72a24a20 fix equal and hash for bytes field for javanano oneof 2015-02-19 16:43:08 -08:00
Jisi Liu
3accf81ea9 Clear oneofs. 2015-02-19 16:43:08 -08:00
Jisi Liu
f173cdeb02 hashcode and equals for oneofs in nano. 2015-02-19 16:43:08 -08:00
Jisi Liu
06a2e29855 Equals for message oneof field in nano. 2015-02-19 16:43:07 -08:00
Jisi Liu
c72d3d51ff Oneof message level elements (consts, case getter/clear) and messsage type field oneof support. 2015-02-19 16:43:07 -08:00
Jisi Liu
7794a98ff4 Initial check-in for message oneof. 2015-02-19 16:43:07 -08:00
Jisi Liu
33222b5a02 Initial check in for primitive oneof fields. 2015-02-19 16:43:07 -08:00
Josh Haberman
55cf8abecb Merge branch 'master' of github.com:google/protobuf 2015-02-17 18:25:20 -08:00
Josh Haberman
cb3caf1e61 Integrate changes from Google open-source branch. 2015-02-17 18:23:41 -08:00
Jisi Liu
2cb2358cba Merge pull request #204 from pherl/master
Implement maps for JavaNano
2015-02-17 14:06:19 -08:00
Chris Fallin
a2bea0a001 Properly support maps in Ruby protoc and another bugfix.
Previously, we supported map fields in the Ruby DSL. However, we never
connected the final link in the chain and generated `map` DSL commands
for map fields in `.proto` files. My apologies -- I had been testing
with the DSL directly so I missed this.

Also fixed a handlerdata-setup-infinite-loop when a map value field's
type is its containing message.
2015-02-12 16:08:01 -08:00
Bo Yang
eb2ce02931 Fix absolute/relative path in output 2015-02-09 11:57:41 -08:00
Gordana Cmiljanovic
b61b0c3304 MIPS: remove immediate constraint within CompareAndSwap.
Improper use of immediate constraint is slightly non-optimal with gcc/gnu-as
but may cause breakage with clang.
2015-02-09 14:04:24 +01:00
Feng Xiao
96e379ff8b Add the .proto files for well-known types. 2015-02-09 12:21:49 +08:00
Nobuaki Sukegawa
de525ec219 Add missing LIBPROTOC_EXPORT to ruby generator 2015-02-08 14:45:38 +09:00
Bo Yang
e2555e235f Change target to output filenames 2015-02-07 15:28:54 -08:00
Jisi Liu
12d8a514c8 Get the map factory per mergeFrom() call for JavaNano. 2015-02-07 12:51:36 -08:00
Jisi Liu
d9a6f27bc3 implement hashCode() for JavaNano maps. 2015-02-06 15:55:04 -08:00
Jisi Liu
1536e93349 Implement Equals for nano. 2015-02-06 15:30:48 -08:00
Jisi Liu
bd3573cb09 Fix the behavior when merging conflicting keys, the new value always
override the existing one even for message types.
2015-02-05 14:52:17 -08:00
Bo Yang
1d627f85c3 Fix comment 2015-02-04 15:48:06 -08:00
Jisi Liu
3c0355ef37 Moving internal code to InternalNano and rename MapUtil to MapFactories. 2015-02-04 13:54:58 -08:00
Bo Yang
3edcbaf57a Clean code 2015-02-04 13:42:16 -08:00
Bo Yang
2e32b8b569 Remove "include sstream" from command_line_interface.cc 2015-02-04 10:27:52 -08:00
Bo Yang
a1b351c55b Change flag for generating dependency file to "dependency_out". Delete
test-driver
2015-02-04 10:20:20 -08:00
Bo Yang
5fa3956ede Fix comments. 2015-02-03 21:51:29 -08:00
Bo Yang
5914ce7a16 Implement a feature to generate a dependency file. By giving protoc the flag
"--dependency_manifest_out=FILE", protoc will write dependencies of
input proto files into FILE. In FILE, the format will be
<full path to FILE>: <full path to 1st proto>\\\n <full path to 2nd proto> ...
This cl is based on https://github.com/google/protobuf/pull/178
2015-02-03 21:35:50 -08:00
Jisi Liu
d5839d2b4d parsing and serialzation for maps in JavaNano. 2015-02-03 18:15:12 -08:00
Jisi Liu
4d64e65f09 Parsing for Maps in JavaNano 2015-02-02 21:06:59 -08:00
Feng Xiao
a22bc812a4 Merge pull request #186 from ennerf/win32-msvc-fix
MSVC protoc compiler fix
2015-02-02 19:37:58 -08:00
Jisi Liu
4a99897c0b Use map generator for maps field; skip entry message. 2015-02-02 14:51:36 -08:00
Joshua Haberman
17e4419188 Merge pull request #168 from cfallin/ruby-oneof
Support oneofs in MRI Ruby C extension.
2015-02-02 13:29:15 -08:00
Florian Enner
e544b38815 removed accidental whitespace 2015-02-02 15:19:01 -05:00
Florian Enner
e1e86b02a8 replaced type fix with the recommended way 2015-01-31 19:22:52 -05:00
Florian Enner
df4730ca9c fixed MSVC compile error
<stdint.h> is not part of the standard, so I've added a workaround.
2015-01-31 19:01:34 -05:00
Jisi Liu
dce816593d Initial checkin for maps support in JavaNano. 2015-01-30 16:14:15 -08:00
Ming Zhao
d1ef42a8e7 Remove unused methods:
MessageTypeProtoName, IsVariableLenType
2015-01-29 22:51:55 -08:00
Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)
f01c1441bc Fix illegal C++ use of reinterpret_cast<> to cast between nullptr_t and a pointer. 2015-01-27 15:44:38 +00:00
Richard Geary
532c94145b Add support for outputting dependency manifest files, used by ninja and make
Use --manifest-file=somefile.d to output the dependency manifest.
This file will contain a list of files which were read by protoc as part
of creating the output files.  It doesn't include the plugin inputs if
plugins are used, that could be a later extension.
The manifest file is in the format <output file>: <input files>.  The
manifest file format only allows you to specify one output file, which
isn't a problem as it's used to detect input changes in order to detect
when to rerun the protoc command.  The output file used in the manifest
is the manifest filename itself; to use this in ninja you should declare
the manifest file as the first output as well as the depfile input.
2015-01-23 12:52:31 -05:00
Martin Ertsaas
e85de03b81 Add support for the TILE-Gx processor family. 2015-01-22 09:10:19 +01:00
Chris Fallin
b0670ddae7 Fix golden-file Ruby test to work with out-of-tree builds. 2015-01-14 16:46:10 -08:00
Chris Fallin
3f3820d8f8 Two tests for Ruby code generator:
- A golden-file test that ensures protoc produces known-valid output.
- A Ruby test that loads that golden file and ensures it actually works
  with the extension.

This split strategy allows us to test end-to-end without needing to
integrate the Ruby gem build system and the protoc build system. This is
desirable because we do not want a gem build/install to depend on
building protoc, and we do not want building protoc to depend on
building and testing the gem.
2015-01-14 15:44:46 -08:00
Chris Fallin
7c4bbf07a5 Support oneofs in the Ruby code generator. 2015-01-14 14:56:17 -08:00
zhangkun83
a6b3ab09e8 Align backslash vertically 2015-01-12 15:56:07 -08:00
zhangkun83
aa1713d9a4 Include names.h as java_names.h in the opensource tree 2015-01-12 15:38:59 -08:00
Kal Conley
c3e928021f Improved little endian byte order detection
Including <sys/param.h> on Mac/iOS doesn't define __BYTE_ORDER so
PROTOBUF_LITTLE_ENDIAN was never being defined. This commit adds a check
for the __LITTLE_ENDIAN__ macro which is defined by clang and Apple gcc on
little endian architectures.
2014-12-16 02:30:45 +01:00
Chris Fallin
5ce69e991a Support Ruby code generation only for proto3. 2014-12-12 18:27:19 -08:00
Feng Xiao
044e095a9b Add missing header files in src/Makefile.am 2014-12-12 17:50:43 -08:00
Chris Fallin
91473dcebf Rename protobuf Ruby module to google/protobuf and rework its build
system. The Ruby module build now uses an amalgamated distribution of
upb, and successfully builds a Ruby gem called 'google-protobuf' with
module 'google/protobuf'.
2014-12-12 15:58:26 -08:00
Feng Xiao
f473bb9903 Merge pull request #128 from krishnanm86/master
Source code refactoring. Extracted common functionality in cpp_helpers.c...
2014-12-12 11:13:15 -08:00
Krishna
2e9f5e3bac Reverting the space at the end for both files changed 2014-12-12 10:26:25 +01:00
Krishna
91552adb77 Reverting the space at the end 2014-12-12 10:25:06 +01:00
Krishna
22f96a713c Returned print_indent and print_outdent back to printservicestub and printserviceclass in python generator 2014-12-12 10:22:48 +01:00
Feng Xiao
001e82a7e0 Merge pull request #113 from nsuke/oneof-c++11
Make C++ code generation of string oneof field compatible with C++11
2014-12-11 16:05:06 -08:00
Krishna
060a2096a3 Reverted changes to cpp_helpers.cc and made code reviews to python_geenerator.cc 2014-12-11 07:45:32 +01:00
Feng Xiao
52909485d1 Merge branch v3.0.0-alpha-1 into master.
Conflicts:
	configure.ac
2014-12-10 20:56:13 -08:00
Krishna
7654f78029 Fixed bugs 2014-12-10 21:02:12 +01:00
Krishna
a761f061f4 Source code refactoring. Extracted common functionality in cpp_helpers.cc and python/python_generator.cc 2014-12-10 20:39:34 +01:00