Commit Graph

470 Commits

Author SHA1 Message Date
xiaofeng@google.com
e406747cd5 Fix issue 445, issue 449 2013-02-07 07:00:07 +00:00
xiaofeng@google.com
1e5a5e8419 Down-integrate from internal branch 2013-01-31 15:52:58 +00:00
liujisi@google.com
691f6da30b Rollback the export macros on internal classes/functions. 2013-01-15 02:19:41 +00:00
liujisi@google.com
117064c18b add missing dll export macros for msvc. 2013-01-11 10:35:05 +00:00
liujisi@google.com
71caf8c25d Remove "using" directives to disambiguate type_traits for vc2012. 2013-01-11 06:36:35 +00:00
liujisi@google.com
f5b373dfb6 Fix a typo of nacl file name. 2013-01-10 21:37:04 +00:00
liujisi@google.com
e9ee30962f Add missing qnx files. 2013-01-10 21:28:15 +00:00
liujisi@google.com
4d8c2f94fb Add arm_qnx atomic ops support and add missing header files in Makefile.am 2013-01-10 21:24:56 +00:00
liujisi@google.com
98080e8598 Update upb namespace in friendship declaration. 2013-01-10 21:05:26 +00:00
liujisi@google.com
cb77c4c381 Generate a warning for duplicated enum values, when allow_alias option isn't
set.
2012-12-28 23:41:54 +00:00
liujisi@google.com
4770277ec7 Add the missing PNaCl atomicops support. 2012-12-19 03:46:58 +00:00
liujisi@google.com
728aa760fd Down-integrate form internal opensource branch 2012-12-19 02:37:59 +00:00
xiaofeng@google.com
0b30eb8c87 Fix the name of thread safety macros. 2012-12-13 09:09:32 +00:00
liujisi@google.com
5d701498dd Remove unused macros. 2012-12-10 18:58:26 +00:00
liujisi@google.com
5e6539205e Remove the customized operator delete. 2012-12-10 18:54:03 +00:00
liujisi@google.com
2273ee403b Add java options to plugin proto and rollback the r450 2012-12-05 23:47:43 +00:00
liujisi@google.com
0c995c9300 Remove undeeded no-rtti guards. 2012-12-05 23:16:07 +00:00
liujisi@google.com
2bee6e66e8 Fix build warnings for gcc 4.6 2012-12-05 22:29:30 +00:00
liujisi@google.com
6fb956d9db Remove extra semicolons 2012-12-05 06:38:29 +00:00
liujisi@google.com
1e36e1006a Add missing export macro 2012-12-05 06:26:08 +00:00
liujisi@google.com
329d103b3e Set pointers to NULL after shutdown, so the shutdown function can be called for multiple times. 2012-12-05 06:18:10 +00:00
liujisi@google.com
f5d5b4de92 Make custom option able to work for -f-no-rtti; Fix remaining death tests for gtest 1.6 2012-12-05 05:54:48 +00:00
liujisi@google.com
1d32532ead Update gtest to 1.6; Disable death tests when exceptions are enabled. 2012-12-04 23:32:47 +00:00
liujisi@google.com
e719489061 Make PROTOBUF_USE_EXCEPTIONS configurable from CPPFLAGS. 2012-12-04 22:06:04 +00:00
xiaofeng@google.com
caa66db018 Merge from tags/2.5.0rc1 to trunk 2012-12-04 18:44:24 +00:00
xiaofeng@google.com
eaaef0b39b Fix issues: 342, 424, 428, 430, 436 2012-12-04 00:59:40 +00:00
liujisi@google.com
ef9acc464d Update version to 2.5.0-pre 2012-11-30 22:38:00 +00:00
xiaofeng@google.com
9c1c31ff16 Fix compile issues under GCC 3.4.6 2012-11-30 16:29:03 +00:00
xiaofeng@google.com
a4491ea142 Fix issue 412: update protobuf for 64-bit compatibility on Mac OS X - patch from Mark Mentovai 2012-11-14 13:38:10 +00:00
pliard@google.com
75575df086 Generate missing inclusion of common.h.
FileGenerator::GenerateBuildDescriptors() emits
"::google::protobuf::internal::OnShutdown(&$shutdownfilename$);" which is
declared in common.h.

Although Protobuf is very well tested a compilation error was triggered while
rolling Protobuf r423:426. There might be something wrong in the Chromium roll
(still in progress).

It seems safer anyway not to rely on indirect headers inclusion.
2012-10-02 00:15:46 +00:00
xiaofeng@google.com
3d46dad1d2 Use string::size_type instead of int for results of string.find() etc. -- patch from hans 2012-09-27 09:04:02 +00:00
xiaofeng@google.com
fcb8a50b50 Update MSVC project files and fix compilation issues in MSVC. 2012-09-24 06:48:20 +00:00
xiaofeng@google.com
b55a20fa2c Down-integrate from internal branch 2012-09-22 02:40:50 +00:00
pliard@google.com
daced74d77 Add support for NaCl in atomicops.
This does additionally a significant cleanup in platform_macros.h (initially
pulled from v8).
It implemented some subtleties that we don't use like the HOST/TARGET arch
distinction.

Changes related to NaCl support come from Chromium's build/build_config.h.

BUG=392
2012-07-17 15:51:05 +00:00
liujisi@google.com
e7881e8e12 Update atomicops to support new platforms where intptr_t = long.
Fix license headers.
2012-06-05 17:02:25 +00:00
liujisi@google.com
aabd7cf8f8 Fix a NULL/bool conversion. 2012-05-17 04:59:53 +00:00
xiaofeng@google.com
2072421124 Fix issue 378 2012-05-16 05:41:31 +00:00
pliard@google.com
a269a2c48b Update outdated use of GoogleOnceType. 2012-05-10 08:04:04 +00:00
pliard@google.com
6103d4ed13 Don't call AddDesc() at static init time in LITE_RUNTIME mode.
This patch makes the generation of StaticDescriptorInitializer_$filename$
depend on whether LITE_RUNTIME is enabled. Note that this works only when
extensions are not used.

This lets us significantly decrease the number of static initializers generated
by protoc in LITE_RUNTIME mode (used in Chromium).
In LITE_RUNTIME mode, $adddescriptorsname$() is called the first time that
default_instance() is called (rather than being called during static init).

To benefit from this patch in LITE_RUNTIME mode without extensions, compile
with -DGOOGLE_PROTOBUF_NO_STATIC_INIT.

BUG=351
2012-05-04 11:16:09 +00:00
pliard@google.com
7cc257673c Improve GoogleOnceInit() in Protocol Buffers.
It is based on V8's new CallOnce(): http://codereview.chromium.org/9447052/.

This patch includes the following changes:
  - POD (no static initializer generated) and faster implementation on Windows.
  - GoogleOnceInit() can now take an additional parameter which is forwarded to
    the function provided by the user.

This patch is part of the static initializers removal initiative.
2012-04-10 08:15:18 +00:00
pliard@google.com
6a10204df6 Add missing guard in atomicops MSVC cc file 2012-03-08 14:27:30 +00:00
pliard@google.com
72afe6ee3f Fix build error in Mac atomicops. 2012-03-06 08:20:45 +00:00
pliard@google.com
324779ad70 Remove static initializer in wire_format_lite.cc. 2012-03-02 14:00:20 +00:00
pliard@google.com
f5de486b53 Add atomicops from V8. 2012-03-02 13:04:36 +00:00
liujisi@google.com
cb6dd4ef5f A workaround for MSVC 2010 x64 platform bug,
which affects proto compiler in generating field has_bit mask.
2011-07-05 21:05:40 +00:00
liujisi@google.com
2a89d0022d Add missing dll export macros. 2011-07-05 17:16:07 +00:00
liujisi@google.com
295a096023 Remove extra semicolon in primitive repeated field init code. 2011-07-05 06:16:40 +00:00
liujisi@google.com
7a6de0008a Update comments for globally unique extension number for custom options. 2011-05-25 06:25:24 +00:00
liujisi@google.com
02d7015ba8 Allow String to be used as message names. 2011-05-04 06:15:22 +00:00
liujisi@google.com
5c24564811 Update mainline version to 2.4.2-pre. 2011-05-03 07:06:03 +00:00
liujisi@google.com
23f42ceaf8 Define serailVersionUID for generated java class. 2011-04-29 01:57:30 +00:00
liujisi@google.com
9cf65b7dd2 Use fully qualified java.lang.Object in protoc java code. 2011-04-08 03:40:29 +00:00
liujisi@google.com
17d57dbbcd Add an intermediate method to propagate the friendship access to nested classes as a workaround for old compilers (e.g. gcc 3.4) 2011-02-07 19:03:53 +00:00
liujisi@google.com
c345db7d6b Update version number to 2.4.1 in common.h. 2011-02-03 07:22:32 +00:00
liujisi@google.com
57014ffa52 Use Subprocess::Win32ErrorMessage() in command_line_interface_unittest to make the it OS locale independent. 2010-12-21 05:56:35 +00:00
liujisi@google.com
5c20ca1fcc Escape C++ Trigraphs. 2010-12-21 05:33:13 +00:00
liujisi@google.com
6f2c3b8734 Boost version number to 2.4.0-pre, add more test cases for text_format.py about unicode field. 2010-12-09 08:59:21 +00:00
liujisi@google.com
9b7f6c544a Fix issues: 223 224 242. 2010-12-08 03:45:27 +00:00
liujisi@google.com
1fd96c43a0 Add new files for vcprojs, fix issues: 165, 211, 228, 240 2010-12-07 06:23:55 +00:00
liujisi@google.com
5d8d2b0542 Fix issues: 200 202 211 215 237 246. 2010-12-06 06:20:14 +00:00
liujisi@google.com
2726e7a6eb Fix issues: 166 167 172 175 181 188 192 194 195. 2010-12-03 09:12:33 +00:00
liujisi@google.com
0acafda8f4 Fix byte encoding macros. 2010-12-01 04:13:50 +00:00
kenton@google.com
baac9c39fe Add some explicit casts to eliminate some warnings as described in issue 83 comment 17. 2010-11-30 23:54:03 +00:00
liujisi@google.com
33165fe0d5 Submit recent changes from internal branch. See CHANGES.txt for more details. 2010-11-02 13:14:58 +00:00
kenton@google.com
a4a9ef8c8b Roll back revision 313. A similar but far more exensive change was made in our internal branch, which will be integrated soon. 2010-09-17 23:20:04 +00:00
kenton@google.com
15b675eea5 add cast to avoid compiler warning 2010-04-23 19:15:05 +00:00
kenton@google.com
d09ab8538d Allow services with lite runtime when using rpc generator plugin. 2010-04-19 19:15:12 +00:00
kenton@google.com
b3f6a15806 Improve coded_stream.h handling on MSVC. Avoid a bogus runtime check and enable little-endian optimization. Based on patch from Nathan McDaniel. 2010-04-05 23:19:54 +00:00
kenton@google.com
6793c1af26 Use full paths when writing MSVS-style errors. Patch from Oleg Smolsky. 2010-04-05 21:45:45 +00:00
kenton@google.com
eeb8fd7dc8 Fix bug with permanent callbacks that delete themselves when run. Patch from Evan Jones. 2010-02-16 21:59:09 +00:00
kenton@google.com
203637497a Remove comment referring to non-protobuf code. 2010-02-10 00:13:33 +00:00
kenton@google.com
769ab6ff03 Fix missing header issue -- INT_MAX is defined in limits.h. I chose to use a different constant rather than add the #include. 2010-02-09 02:09:08 +00:00
kenton@google.com
c65c04195d Fix issue 162: generated code should #include <algorithm> for std::swap(). 2010-02-01 20:35:34 +00:00
kenton@google.com
daee05168e Optimize Java string serialization. Patch from Evan Jones. 2010-02-01 17:41:59 +00:00
kenton@google.com
ab6950d75d More Java warning tweaks from Evan Jones. 2010-01-28 01:09:11 +00:00
kenton@google.com
4844368346 Add missing include (that apparently didn't break anything on most platforms). 2010-01-20 01:59:22 +00:00
kenton@google.com
08e9036f61 Fix obvious syntax error that somehow works fine on MSVC and GCC 3.x-win32. 2010-01-20 01:54:38 +00:00
kenton@google.com
529a843f2d Fix issues with Windows build: Always use ASCII version of CreateProcess (even if UNICODE is defined) and move GetMessage macro work-around to common.h so that it covers extension_set.h as well. Patch from Nick Carter. 2010-01-15 02:28:48 +00:00
kenton@google.com
c25f833baf Fixes compile on GCC 3.2 according to Sergey Tihansky. 2010-01-13 23:43:19 +00:00
kenton@google.com
2113840aa0 Fix bogus sign-compare warnings in header at request of user. 2010-01-11 18:38:22 +00:00
kenton@google.com
ea75323710 Update version number in trunk to 2.3.1. 2010-01-09 01:02:25 +00:00
kenton@google.com
f9fa0590bc Fix memory leak in CommandLineInterface, not that it really matters. 2010-01-08 05:47:13 +00:00
kenton@google.com
38fcd39227 Minor compatibility tweaks for FreeBSD. 2010-01-08 04:48:19 +00:00
kenton@google.com
7b7a80eae4 Tweak doc comments. 2010-01-08 03:56:03 +00:00
kenton@google.com
2773bdf239 Add missing file to dist. 2010-01-07 04:14:34 +00:00
kenton@google.com
535301894e Address comments from various code reviews. 2010-01-07 02:08:03 +00:00
kenton@google.com
2429e3a0de Monty Taylor claims this helps the drizzle compile for some reason. 2010-01-05 22:30:28 +00:00
kenton@google.com
d78ca9c74f Fixed DLL compile under MSVC. 2010-01-04 21:15:47 +00:00
kenton@google.com
c619a3da2a Fix syntax of function definition in shell script so that it hopefully works on Solaris. 2010-01-04 20:03:09 +00:00
kenton@google.com
d2fcbba230 Improve zip/jar support:
- Don't support par or war since par is not a standard format and outputting to
  war doesn't make sense.
- Add boilerplate manifest when outputting to Jar.
- Remove "XXX check conversion" comments because I don't care.
- Add a test.
2010-01-04 19:47:18 +00:00
kenton@google.com
5066322074 Allow protoc to output directly to zip/jar/par/war files. 2009-12-24 02:12:15 +00:00
kenton@google.com
5f12164f54 Refactor the way output is handled in CommandLineInterface -- now it will be stored in-memory until all code generators have completed, then dumped to disk all at once. While this means that protoc uses more memory, the code is much simpler, and handles insertions much faster. Also, this made it easier to implement a useful feature: insertions will be indented to match the insertion point line. Therefore, when inserting into Python code, you don't have to figure out how much to indent your inserted code. The refactoring should also make it easier to implement output-to-jar at some point. 2009-12-23 07:03:06 +00:00
kenton@google.com
46ed74e8d4 Actually, that last revision can be simpler -- we don't need to parse strings at all, as simply entering 1e1000 as a float literal in Python will be evaluated as infinity. 2009-12-23 02:08:05 +00:00
kenton@google.com
d0047c43d9 In Python, avoid relying on float('inf') and float('nan') as these don't work on Windows with Python pre-2.6. 2009-12-23 02:01:01 +00:00
kenton@google.com
6e8b9e4a4a Make extension identifiers final. This improves security when untrusted code is present in the same class loader. In order to get around initialization ordering issues, I simply made the constructor for extension identifiers take no arguments and deferred initialization to an internalInit() method, which generated code will always call during init. 2009-12-22 23:51:20 +00:00
kenton@google.com
7f4938b244 Mark plugins as experimental for now. 2009-12-22 22:57:39 +00:00
kenton@google.com
d6e84b3ed8 When serializing to an ostream, verify that there were no stream-level errors before returning success. 2009-12-22 19:43:41 +00:00
kenton@google.com
6f12e3e29a Accept form feeds as whitespace. 2009-12-22 18:11:09 +00:00
kenton@google.com
f9c5978f5d Hopefully fix build on Sun Studio. 2009-12-22 18:04:23 +00:00
kenton@google.com
c0ee4d2ed9 Build DLLs on Cygwin and MinGW. 2009-12-22 02:05:33 +00:00
kenton@google.com
d1ce7a2839 Fix build on MSVC. 2009-12-21 21:19:05 +00:00
kenton@google.com
f2a732938e Fix build on GCC 3.3/Linux. 2009-12-21 19:44:57 +00:00
kenton@google.com
0abe9c2143 Argh, this line was not supposed to be submitted. 2009-12-21 19:24:21 +00:00
kenton@google.com
ee7e9420e3 Use unordered_map when available. Changes to stl_hash.m4 provided by Oleg Smolsky. 2009-12-21 18:58:23 +00:00
temporal
8ee1474044 Add a code generator insertion point for Java builders. 2009-12-20 00:09:50 +00:00
kenton@google.com
684d45b2fe Fix build on MinGW/Win32 (including implementing Subprocess using CreateProcess()). 2009-12-19 04:50:00 +00:00
temporal
bdbb863099 Ensure that 'once' objects are declared using the macro. This is either the third or fourth time I've screwed this up when down-integrating, because our internal code does not require the macro (it's not portable) and on Linux a pthread_once_t that is zero-initialized just happens to work. So, I only discover the problem when I test on Mac, then kick myself for making the same mistake yet again. No more! This time, I have renamed GoogleOnceType to ProtobufOnceType, thus making the type name differ from our internal code. As a result, if you don't update the decls to use the macros, they won't compile. Hah! Take that, future self! 2009-12-18 08:21:00 +00:00
kenton@google.com
91218afc67 Fix Cygwin build. 2009-12-18 07:20:43 +00:00
kenton@google.com
5e744ff961 Commit missing files from r251. Sigh. 2009-12-18 04:51:42 +00:00
kenton@google.com
afd32abb75 Set version to 2.3.0-pre. 2009-12-18 02:51:26 +00:00
kenton@google.com
83ad01e35f Point test_plugin at the correct gtest headers. 2009-12-18 02:40:43 +00:00
kenton@google.com
fccb146e3f Massive roll-up of changes. See CHANGES.txt. 2009-12-18 02:11:36 +00:00
kenton@google.com
b221008884 Fix UTF-8 validity checks to not do unaligned reads. 2009-12-11 03:49:28 +00:00
kenton@google.com
de74779454 fix SONAME in trunk 2009-12-11 03:41:58 +00:00
jasonh+personal@google.com
9951233e9a Fix Issue 136: the memoized serialized size for packed fields may not
be properly set. writeTo() may be invoked without a call to
getSerializedSize(), so the generated serialization methods would
write a length of 0 for non-empty packed fields. Just call
getSerializedSize() at the beginning of writeTo(): although this
means that we may compute the byte size needlessly when there
are no packed fields, in practice, getSerializedSize() will
already have been called - all of the writeTo() wrappers in
AbstractMessageLite invoke it.

Tested: new unittest case in WireFormatTest.java now passes
2009-12-01 18:05:21 +00:00
Dan Egnor
95dbaa67a8 The j2me protobuf code is now in vendor/google; remove it here. 2009-11-13 17:14:51 -08:00
kenton@google.com
573989f782 Explicitly call superclass constructor in generated code to avoid pedantic warning. Based on patch from Oleg Smolsky. 2009-10-30 22:02:17 +00:00
kenton@google.com
c91e1fe82b Support MSVC 2010 beta 1. 2009-10-12 19:22:03 +00:00
kenton@google.com
477f799fb6 Improve error message regarding proto_path not matching .proto file. 2009-10-07 21:38:11 +00:00
kenton@google.com
721995d00a Fix cross-compiling when building in a dedicated build directory. Fix pointed out by Pierre Kestener. 2009-09-11 22:08:40 +00:00
kenton@google.com
7fb9ae9df3 Make sure to quality calls to std::swap. Otherwise, if a google::swap() exists (e.g. because the user is using our own dense_hash_map implementation) it will be chosen instead, leading to a compile error. 2009-09-02 02:42:56 +00:00
kenton@google.com
b26684a900 Remove test that had undefined behavior and thus did not pass on some platforms. 2009-09-02 01:42:04 +00:00
kenton@google.com
3aa7a0dafe HPUX patch from Alexander Melnikov. 2009-08-17 20:34:29 +00:00
temporal
ad5672bad7 Update experimental SEBS file to support cross-compiling. 2009-08-17 09:42:47 +00:00
kenton@google.com
0bcfeb9dcd Don't use RTTI in down_cast if GOOGLE_PROTOBUF_NO_RTTI is defined. Patch from Chris Masone (of Google). 2009-08-14 01:21:01 +00:00
kenton@google.com
8169c7fcde Set version number to 2.2.1 in trunk. 2009-08-13 22:41:37 +00:00
kenton@google.com
8aae2a2137 Oops, unittest_enormous_descriptor.proto still needs to be in the dist. 2009-08-11 00:23:25 +00:00
kenton@google.com
e133abd01c Don't build unittest_enormous_decsriptor.proto in C++ because it's very slow on older GCCs. This file was meant for testing Java anyway. 2009-08-11 00:18:23 +00:00
kenton@google.com
09b9e99bd3 Make tests compile on Sun Studio. Patch from Monty Taylor. 2009-08-10 20:23:41 +00:00
temporal
bcb791a9d0 Experimental alternative build definition. 2009-08-10 08:12:18 +00:00
kenton@google.com
323e6321c6 doc comment tweaks 2009-08-08 03:23:04 +00:00
kenton@google.com
75fcd790c4 Silence pedantic warning about unused parameter. 2009-08-07 21:51:30 +00:00
kenton@google.com
7ddfb4c3c7 Remove semi-broken Java thread-local builder freelist 'optimization'. Maybe bring back later in optional form. 2009-08-07 21:19:29 +00:00
kenton@google.com
68996fc874 Gigantic descriptors shouldn't overflow the Java string literal size limit. 2009-08-07 21:02:02 +00:00
kenton@google.com
445f1023e1 Update version number to 2.2.0-pre. 2009-08-06 23:01:43 +00:00
kenton@google.com
1a34c92e73 Make sure GeneratedMessageFactory is deleted on shutdown. 2009-08-06 22:17:26 +00:00
kenton@google.com
58ebb1ccf8 Fix argument order -- I guess this macro is unused... 2009-08-04 01:23:07 +00:00
temporal
43af40dcca Remove @Override annotations that cause compiler errors on Java 1.5. 2009-08-01 07:37:11 +00:00
temporal
f837b0066d Use the nice macro to declare once-init control objects, like good little coders should. Otherwise the initialization routines never run on Mac. TODO: Investigate how this was broken. 2009-08-01 07:30:49 +00:00
kenton@google.com
9270a99d2e Make DLLs work again. 2009-08-01 02:16:55 +00:00
kenton@google.com
c3a24531d1 Hurr, some merge conflict was resolved poorly. Fixed. 2009-08-01 00:44:01 +00:00
kenton@google.com
253a850804 Allow compression level of GzipOutputStream to be configured. 2009-08-01 00:38:45 +00:00
kenton@google.com
1900c536cd Fix compile for GCC 3.4.4. 2009-08-01 00:30:11 +00:00
kenton@google.com
c137750365 Remove two empty source files. This doesn't actually have any effect on code size but might as well get rid of them. 2009-07-29 21:48:13 +00:00
kenton@google.com
4f3491ee5f Decouple strutil from C++ lite library for a further 23k reduction. 2009-07-29 21:33:08 +00:00
kenton@google.com
858a22be11 Define libprotobuf-lite in Makefile.am.
TODO:  Compile conditionally?  Provide a way to omit ExtensionSet?
  Should libprotobuf depend on libprotobuf-lite instead of being a
  stand-alone lib?
2009-07-29 02:21:47 +00:00
kenton@google.com
80b1d62bfc Submit recent changes from internal branch, including "lite mode" for
C++ and Java.  See CHANGES.txt for more details.
2009-07-29 01:13:20 +00:00
kenton@google.com
d2fd0638c3 Down-integrate some code from an internal branch. (More to come.) 2009-07-24 01:00:35 +00:00
kenton@google.com
ceb561d65b Add Swap(), SwapElements(), and RemoveLast() to Reflection. Patch by Scott Stafford. 2009-06-25 19:05:36 +00:00
Adam Bliss
c1a443d486 Adds a few utilities to ProtoBufUtil, integrating over from mainline 2009-06-10 17:40:19 -07:00
Mitsuru Oshima
7e013cacd4 Revert "ProtoBuf update"
This reverts commit 9aaf507646c866ab131bf2bcd973882ff9f553cf.
2009-06-10 16:16:02 -07:00
Mitsuru Oshima
babfb77851 ProtoBuf update
* Added IntMap that uses Hashtable for larger keys
 * Chagned to use IntMap to allow larger tags
 * Changed to use autoboxing for int/longs.
2009-06-10 10:28:53 -07:00
kenton@google.com
f22943c7d0 Fix build problem with -std=gnu++0x. 2009-06-01 18:27:23 +00:00
kenton@google.com
b43727981c Fix final leak (win32 only). 2009-05-18 18:38:56 +00:00
kenton@google.com
1fb3d394e5 Update version number in trunk. 2009-05-13 23:20:03 +00:00
kenton@google.com
1d4df6caa4 Fix compile error on Cygwin, where int32 is typedefed to long instead of int, and the compiler can't figure out which overload of this method to use in that case. 2009-05-06 22:17:46 +00:00
kenton@google.com
63e646b7ad Provide ShutdownProtobufLibrary() which frees all startup-allocated objects. 2009-05-06 19:27:03 +00:00
kenton@google.com
9824eda6b5 enable cross-compiling 2009-05-06 17:49:37 +00:00
kenton@google.com
42c81e1a76 Set better default CXXFLAGS and don't use optimization when compiling tests
(takes too long).
2009-05-06 01:15:06 +00:00
temporal
1589b1d8c1 Fix startup crash when statically linking on Mac. 2009-04-28 08:09:44 +00:00
kenton@google.com
c5ff06cc74 Add second run of cpp_unittest which verifies that descriptors are constructed lazily. This is accomplished by avoiding any use of descriptors while testing a bunch of other operations, then checking at the end that descriptors have not been constructed. 2009-04-28 03:06:41 +00:00
kenton@google.com
503a4dd705 Convert some \u escape sequences to UTF-8 because MSVC interprets them differently. 2009-04-28 02:16:53 +00:00
kenton@google.com
30be0a8758 Don't use dll-export declspec on class-nested extensions. 2009-04-28 02:10:27 +00:00
kenton@google.com
ccc11678c7 Make building libprotobuf as a DLL work again. 2009-04-28 01:48:06 +00:00
kenton@google.com
ef3730c2df Add test verifying that protoc accepts trailing backslashes on Windows, which some users claim doesn't work. Seems to work on my machine. 2009-04-28 00:49:36 +00:00
kenton@google.com
d33e53ad4c That last rev shouldn't have compiled, but apparently did, for some reason. Fixed. 2009-04-28 00:44:15 +00:00
kenton@google.com
db4b583084 Protect a new death test with GTEST_HAS_DEATH_TEST, since MinGW doesn't support it. 2009-04-28 00:42:42 +00:00
kenton@google.com
50ede8ba17 Update MSVC project files for rev 120, and add instructions for compiling with zlib. 2009-04-27 22:28:10 +00:00
kenton@google.com
d37d46dfbc Integrate recent changes from Google-internal code tree. See CHANGES.txt
for details.
2009-04-25 02:53:47 +00:00
kenton@google.com
709ea28f32 Work around windows.h #defining GetMessage(). 2009-04-22 20:06:20 +00:00
kenton@google.com
6f9bc71ffd Add missing LIBPROTOBUF_EXPORT. 2009-04-22 04:04:27 +00:00
kenton@google.com
37ad00d2c4 Update bundled gtest to latest version (1.3.0) and include it as a
nested autoconf package rather than as raw source.  This way we can
trivially update it again in the future.

Actually, this change doesn't even include gtest in protobuf's SVN.
Instead, we auto-download it when autogen.sh is invoked.  Note that
it will be included in release distributions, though.

TODO:
* Add a configure option to use the system's installed gtest rather
  than the bundled copy.  Apparently the gtest maintainers are working
  on some general-purpose autoconf macros which will do this
  automagically.
* Update MSVC project files.
2009-04-21 21:00:39 +00:00
kenton@google.com
6dcd46c8d2 Fix initialization ordering problem in logging code. Based on patch from Wink Saville. 2009-04-18 01:24:27 +00:00
kenton@google.com
cfa2d8aa87 Generate field number constants. Patch from Michael Poole. 2009-04-18 00:02:12 +00:00
kenton@google.com
eb26a1efde Commit Michael Poole's patch for explicitly constructing all class fields in
generated code.
2009-04-16 22:43:40 +00:00
kenton@google.com
e59427a62c Commit Brian Olson's gzip stream implementations. 2009-04-16 22:30:56 +00:00
kenton@google.com
f663b1602d Adds a flag to protoc called --error_format which specifies what
convention to use when printing errors.  Default is GCC, but Microsoft
Visual Studio is another option.  This allows errors to be clickable in
the MSVS error log.
2009-04-15 19:50:54 +00:00
The Android Open Source Project
5a08423c59 auto import from //branches/cupcake_rel/...@140373 2009-03-18 17:39:44 -07:00
The Android Open Source Project
82155ace01 auto import from //depot/cupcake/@135843 2009-03-03 19:30:31 -08:00
The Android Open Source Project
778b51ced8 auto import from //depot/cupcake/@135843 2009-03-03 18:28:35 -08:00
The Android Open Source Project
a3cc5f1795 auto import from //depot/cupcake/@132589 2009-03-03 14:04:14 -08:00
The Android Open Source Project
bb7bbd7c9c auto import from //depot/cupcake/@137055 2009-03-02 22:54:29 -08:00
The Android Open Source Project
52067f67ad auto import from //branches/cupcake/...@132276 2009-02-19 10:57:31 -08:00
The Android Open Source Project
f83a870b18 auto import from //branches/cupcake/...@130745 2009-02-10 15:43:59 -08:00
kenton@google.com
1556623fad Submit files missing from previous submit. 2009-02-10 17:47:02 +00:00
kenton@google.com
2d6daa72ab Push out changes from internal codebase.
All Languages
* Repeated fields of primitive types (types other that string, group, and
  nested messages) may now use the option [packed = true] to get a more
  efficient encoding.  In the new encoding, the entire list is written
  as a single byte blob using the "length-delimited" wire type.  Within
  this blob, the individual values are encoded the same way they would
  be normally except without a tag before each value (thus, they are
  tightly "packed").

C++
* UnknownFieldSet now supports STL-like iteration.
* Message interface has method ParseFromBoundedZeroCopyStream() which parses
  a limited number of bytes from an input stream rather than parsing until
  EOF.

Java
* Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
* Message interface has new method toBuilder() which is equivalent to
  newBuilderForType().mergeFrom(this).
* All enums now implement the ProtocolMessageEnum interface.
* Setting a field to null now throws NullPointerException.
* Fixed tendency for TextFormat's parsing to overflow the stack when
  parsing large string values.  The underlying problem is with Java's
  regex implementation (which unfortunately uses recursive backtracking
  rather than building an NFA).  Worked around by making use of possesive
  quantifiers.

Python
* Updated RPC interfaces to allow for blocking operation.  A client may
  now pass None for a callback when making an RPC, in which case the
  call will block until the response is received, and the response
  object will be returned directly to the caller.  This interface change
  cannot be used in practice until RPC implementations are updated to
  implement it.
2009-01-22 01:27:00 +00:00
kenton@google.com
d41578239c Update trunk version to 2.0.4-SNAPSHOT. 2008-12-05 22:04:06 +00:00
kenton@google.com
25bc5cdc9c Support "Solaris 10 using recent Sun Studio".
Patch from Monty Taylor <monty.taylor@gmail.com>.
2008-12-04 20:34:50 +00:00
kenton@google.com
1ea526879c Add full-system test for custom enum value options. (Previously, only a
parsing test in parser_unittest.cc existed.)
2008-12-02 20:08:45 +00:00
kenton@google.com
2f669cbe75 * Avoid using pushd/popd in generate_descriptor_proto.sh because they are
bash-only features, and /bin/sh is not a symlink to bash on all systems.
* If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
  the import path only contains "." (or contains "." but does not contain
  the file), protoc incorrectly thought that the file was under ".", because
  it thought that the path was relative (since it didn't start with a slash).
  This has been fixed.
2008-12-02 05:59:15 +00:00
kenton@google.com
a001ed0c03 * Update version compatibility stuff -- 2.0.3 is in no way compatible with
2.0.2.
* Minor Tru64 fix.
2008-12-01 23:47:49 +00:00
kenton@google.com
26bd9eee6e Integrate changes from internal code.
protoc
* Enum values may now have custom options, using syntax similar to field
  options.
* Fixed bug where .proto files which use custom options but don't actually
  define them (i.e. they import another .proto file defining the options)
  had to explicitly import descriptor.proto.
* Adjacent string literals in .proto files will now be concatenated, like in
  C.

C++
* Generated message classes now have a Swap() method which efficiently swaps
  the contents of two objects.
* All message classes now have a SpaceUsed() method which returns an estimate
  of the number of bytes of allocated memory currently owned by the object.
  This is particularly useful when you are reusing a single message object
  to improve performance but want to make sure it doesn't bloat up too large.
* New method Message::SerializeAsString() returns a string containing the
  serialized data.  May be more convenient than calling
  SerializeToString(string*).
* In debug mode, log error messages when string-type fields are found to
  contain bytes that are not valid UTF-8.
* Fixed bug where a message with multiple extension ranges couldn't parse
  extensions.
* Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
  a message that contained no fields (but possibly contained extensions).
* Fixed ShortDebugString() to not be O(n^2).  Durr.
* Fixed crash in TextFormat parsing if the first token in the input caused a
  tokenization error.

Java
* New overload of mergeFrom() which parses a slice of a byte array instead
  of the whole thing.
* New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
* Improved performance of isInitialized() when optimizing for code size.

Python
* Corrected ListFields() signature in Message base class to match what
  subclasses actually implement.
* Some minor refactoring.
2008-11-21 00:06:27 +00:00
kenton@google.com
a2a32c2043 Support HP C++ on Tru64.
Patch (mostly) by Vincent Choinière <Choiniere.Vincent@hydro.qc.ca>.
2008-11-14 17:29:32 +00:00
kenton@google.com
8da400ed12 Fix bugs in zero_copy_stream_impl.
Patch from Frank Chu.
2008-11-07 18:38:13 +00:00
kenton@google.com
32d0c3b853 Only build tests when running "make check", not "make". 2008-11-07 18:06:24 +00:00
kenton@google.com
d0580eafd3 Fixed alignment issue that caused bus errors on platforms like sparc which
require all memory reads to be aligned.  Specifically, it turns out that
sizeof(RepeatedField<bool>) is 20 on 64-bit sparc with GCC 3.4.6.  This is
strange, since one of RepeatedField's members is a pointer, which I thought
meant that it had to be 64-bit aligned, which means its size should be a
multiple of 64 bits.  But, 20 is not a multiple of 8.  I don't understand why
this is the case, but if this is possible, then DynamicMessage's strategy of
sorting fields in descending order by size and then tightly packing doesn't
work.  To fix this, I got rid of the sort step and instead added code that
aligns each field's offset appropriately based on the field's size.

Also in this revision:  Fix an error message that named a flag incorrectly.
2008-11-07 02:07:18 +00:00
kenton@google.com
de75437573 Simplify some template usage so that older compilers can handle it. (Users
report that MSVC 2003 in particular needs this change.)
2008-11-06 21:36:28 +00:00
kenton@google.com
3e91fcdd87 Work around GCC 4.3.0 x86_64 compiler bug (seen on Fedora 9).
Details:

For each message type, protoc generates an array of byte offsets of each of
the fields within the message class.  These offsets are later used by the
reflection implementation.  Prior to this revision, the offset arrays were
allocated as global variables.  Since they were just arrays of ints, they
should have been initialized at compile time.  Unfortunately, GCC 4.3.0
incorrectly decides that they cannot be initialized at compile time because
the values used to initialize the array have type ptrdiff_t, and GCC 4.3.0
does not recognize that it can convert ptrdiff_t to int at compile time.  This
bug did not seem to exist in previous versions of GCC.  Google's compiler
team has submitted a fix for this bug back to the GCC project, but we will
have to work around it anyway since Fedora 9 shipped with GCC 4.3.0.
2008-11-06 04:37:30 +00:00
The Android Open Source Project
35be73bfeb Initial Contribution 2008-10-21 07:00:00 -07:00
kenton@google.com
3bdc135653 Avoid an "unused parameter" warning when using high warning levels. 2008-10-16 23:00:34 +00:00
kenton@google.com
7b29a2695c Update version number to 2.0.3-SNAPSHOT. 2008-10-16 22:56:18 +00:00
kenton@google.com
a41a9dd532 * Fixed template specialization syntax that MSVC 2005 didn't like. Not sure if
it was valid or not.
* Moved UTF-8 coding directive to the right place in reflection_test.py.
2008-10-03 17:27:48 +00:00
kenton@google.com
9b10f5845a * Fix build on MSVC.
* Switch to statically-linked libraries instead of DLLs on MSVC.
2008-09-30 00:09:40 +00:00
kenton@google.com
0b3023fa65 Add file missing from rev 50. 2008-09-24 20:32:37 +00:00
kenton@google.com
24bf56fb3a Integrate changes from internal Google-internal branch.
General
  * License changed from Apache 2.0 to New BSD.
  * It is now possible to define custom "options", which are basically
    annotations which may be placed on definitions in a .proto file.
    For example, you might define a field option called "foo" like so:
      import "google/protobuf/descriptor.proto"
      extend google.protobuf.FieldOptions {
        optional string foo = 12345;
      }
    Then you annotate a field using the "foo" option:
      message MyMessage {
        optional int32 some_field = 1 [(foo) = "bar"]
      }
    The value of this option is then visible via the message's
    Descriptor:
      const FieldDescriptor* field =
        MyMessage::descriptor()->FindFieldByName("some_field");
      assert(field->options().GetExtension(foo) == "bar");
    This feature has been implemented and tested in C++ and Java.
    Other languages may or may not need to do extra work to support
    custom options, depending on how they construct descriptors.

  C++
  * Fixed some GCC warnings that only occur when using -pedantic.
  * Improved static initialization code, making ordering more
    predictable among other things.
  * TextFormat will no longer accept messages which contain multiple
    instances of a singular field.  Previously, the latter instance
    would overwrite the former.
  * Now works on systems that don't have hash_map.

  Python
  * Strings now use the "unicode" type rather than the "str" type.
    String fields may still be assigned ASCII "str" values; they will
    automatically be converted.
  * Adding a property to an object representing a repeated field now
    raises an exception.  For example:
      # No longer works (and never should have).
      message.some_repeated_field.foo = 1
2008-09-24 20:31:01 +00:00
kenton@google.com
3121a56ab4 Add file that was mysteriously missing from SVN tree. 2008-09-23 21:05:07 +00:00
kenton@google.com
a69deb6477 Explicitly identify superclass in initializer lists for generated message
classes.  This avoids a warning when using GCC's -pedantic option.
2008-09-23 20:03:24 +00:00
kenton@google.com
4410396f11 Work around absence of hash_map.
Also, update version numbers to 2.0.2-SNAPSHOT.
2008-09-19 16:53:32 +00:00
temporal
4014b9f83f Add @Override annotation to generated Java code where appropriate.
Patch from Brian Atkinson <nairb774@gmail.com>.
2008-09-17 02:41:14 +00:00
temporal
742e40975a 2.0.1 release. 2008-08-27 19:25:48 +00:00
temporal
dd681ad786 More prep for 2.0.1:
* Fix version number test so that it accepts "2.0.1rc1".
* Add missing type_checkers.py to Makefile.am.
2008-08-18 22:55:31 +00:00
temporal
779f61c6a3 Integrate recent changes from google3.
protoc
- New flags --encode and --decode can be used to convert between protobuf text
  format and binary format from the command-line.
- New flag --descriptor_set_out can be used to write FileDescriptorProtos for
  all parsed files directly into a single output file.  This is particularly
  useful if you wish to parse .proto files from programs written in languages
  other than C++: just run protoc as a background process and have it output
  a FileDescriptorList, then parse that natively.

C++
- Reflection objects are now per-class rather than per-instance.  To make this
  possible, the Reflection interface had to be changed such that all methods
  take the Message instance as a parameter.  This change improves performance
  significantly in memory-bandwidth-limited use cases, since it makes the
  message objects smaller.  Note that source-incompatible interface changes
  like this will not be made again after the library leaves beta.

Python
- MergeFrom(message) and CopyFrom(message) are now implemented.
- SerializeToString() raises an exception if the message is missing required
  fields.
- Code organization improvements.
- Fixed doc comments for RpcController and RpcChannel, which had somehow been
  swapped.
2008-08-13 03:15:00 +00:00
temporal
a0f27fcd96 Heuristically detect sub-messages when printing unknown fields.
Patch mostly written by Dilip Joseph <dilip.antony.joseph@gmail.com>.
2008-08-06 01:12:21 +00:00
temporal
8ccb79057e Apply Leandro Lucarella <llucax@gmail.com>'s patches for VIM highlighting
and not setting execute bit on protoc outputs.
2008-07-31 01:43:34 +00:00
temporal
6fdb0964e3 Fix static initialization ordering bug that caused crashes at startup when
compiling on Mac with static linking.
2008-07-25 04:38:05 +00:00
temporal
f206351d14 Sync code with Google-internal branch. Changes:
Protoc (parser)
- Improved error message when an enum value's name conflicts with another
  symbol defined in the enum type's scope, e.g. if two enum types declared
  in the same scope have values with the same name.  This is disallowed for
  compatibility with C++, but this wasn't clear from the error.
C++
- Restored the set_foo(const char*) accessor for "bytes" type because some
  code inside Google depends on it.  However, set_foo(const char*, int) is
  still there (and actually is changed to take const void*).
- Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
- Other irrelevant tweaks.
Java
- Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
- Fixed TextFormat's parsing of "inf" and "nan".
- Fixed TextFormat's parsing of comments.
Python
- Fixed text_format_test on Windows where floating-point exponents sometimes
  contain extra zeros.
2008-07-23 01:19:07 +00:00
temporal
cc930432c2 misc. stuff:
- Improved readmes.
- Fixed incorrect definition of kint32min.
- Fixed absolute output paths on Windows.
- Added info to Java POM that will be required when we upload the
  package to a Maven repo.
2008-07-21 20:28:30 +00:00
temporal
e773b43253 Allow trailing slashes in --proto_path mappings.
Patch by Kevin Ko <kevin.s.ko@gmail.com>.
2008-07-16 20:57:56 +00:00
temporal
928ebb6b55 Fix bytes type setter to work with byte sequences with embedded NULLs.
Patch from Alkis Evlogimenos <alkis@evlogimenos.com>.
2008-07-16 02:00:27 +00:00
temporal
40ee551715 Initial checkin. 2008-07-10 02:12:20 +00:00