Commit Graph

730 Commits

Author SHA1 Message Date
Jon Skeet
0101a59b62 Remove vestigial reference to MakeFixedTag 2015-09-01 13:27:26 +01:00
Feng Xiao
0087da9d47 Merge remote-tracking branch 'origin/master' into beta-1
Conflicts:
	src/google/protobuf/extension_set.h
2015-08-29 16:42:55 -07:00
Feng Xiao
f0640b5a04 Merge pull request #770 from pkasting/string_space
Move StringSpaceUsedIncludingSelf to lite library.
2015-08-28 14:09:00 -07:00
Feng Xiao
69ac02a216 Merge pull request #771 from pkasting/static_init_1
Remove a static initializer by removing a global of non-POD type.
2015-08-28 14:05:01 -07:00
Feng Xiao
67946e98a9 Merge pull request #569 from redivo/master
Fix GOOGLE_PROTOBUF_ATOMICOPS_ERROR syntax error
2015-08-28 13:34:35 -07:00
Feng Xiao
fb0af6d02e Merge pull request #768 from pkasting/time
Delete kNanosPerSecond from time.cc.
2015-08-28 10:28:44 -07:00
Peter Kasting
4f3bead537 Remove a static initializer by removing a global of non-POD type.
These are banned by the Google style guide, and Chromium has a hard
no-new-static-initializers policy preventing updating to a new version of
libprotobuf unless this is resolved.  This is the first such change, I'll need
to make at least one more in the future.

Luckily, the protobuf source tree already has an alternative to static
initializers in once.h; use that machinery instead.

I defined everything in the .cc file in a blob to replace the old implementation
rather than matching the .h layout precisely; let me know if a different
ordering is preferred.  I also eliminated the macro that used to be used here as
spelling everything out only takes one additional line, and the macro didn't
actually handle all details of using a particular member variable, just the
declaration, so it felt a bit error-prone.
2015-08-27 20:16:33 -07:00
Feng Xiao
47210ccd77 Merge pull request #746 from zmodem/fix_predict_macros2
Fix the no-op definitions of GOOGLE_PREDICT_{TRUE,FALSE}
2015-08-27 15:52:07 -07:00
Peter Kasting
b913cbd307 Move StringSpaceUsedIncludingSelf to lite library.
This came up because Chromium downstream modifies the lite library in a way that
requires this function, but I'm upstreaming it because based on the comments in
repeated_field.h, this ought to allow resolution of an existing hack.

I don't know enough about the protobuf code to feel confident trying to resolve
this hack myself, so I've merely updated the TODO comments.
2015-08-27 14:37:18 -07:00
Peter Kasting
d680159527 Delete kNanosPerSecond from time.cc.
This variable is unused, and thus triggers a build warning on MSVC.
2015-08-27 14:19:51 -07:00
Peter Kasting
2e789bc246 Avoid #including system headers from inside a namespace.
port.h #includes various headers in order to define byteswap functions, but it
currently does so from inside the google::protobuf namespace.  This can cause
bizarre symbol conflicts and other build errors as these headers' contents are
then included inside this namespace.

Instead, #include the relevant headers above the namespace declarations.
2015-08-27 14:16:10 -07:00
Feng Xiao
8e102ad158 Update generated file. 2015-08-26 20:59:59 -07:00
Paul Yang
106f3eb985 Merge pull request #750 from TeBoring/beta-1
Fix bugs for objectivec
2015-08-26 16:25:56 -07:00
TeBoring
aca5a60883 Fix bugs for objectivec 2015-08-26 16:24:06 -07:00
Feng Xiao
d9f4636818 Add a TODO to clean-up the LITTLE_ENDIAN macro. 2015-08-26 22:40:41 +01:00
Feng Xiao
b47bf4c930 Assume LITTLE_ENDIAN for windows build. 2015-08-26 22:32:04 +01:00
Feng Xiao
b7bbe54321 Remove an unused typedef. 2015-08-26 13:45:30 -07:00
Feng Xiao
042bfaf67f Merge remote-tracking branch 'origin/master' into beta-1 2015-08-26 13:33:50 -07:00
Feng Xiao
b00595a3a9 Merge pull request #709 from xfxyjwf/map_bug
Fix JSON map fields parsing.
2015-08-26 13:18:04 -07:00
Jan Tattermusch
276ce8c15b add static cast to silence signedness comparison warning 2015-08-26 13:10:05 -07:00
Hans Wennborg
fcf1b57579 Fix the no-op definitions of GOOGLE_PREDICT_{TRUE,FALSE}
Updating to the current protobuf version caused the following build errors in
Chromium when using Clang on Windows:

..\..\third_party\protobuf\src\google/protobuf/stubs/fastmem.h(67,43) :  error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
  if (GOOGLE_PREDICT_FALSE(n_rounded_down == 0)) {  // n <= 7
                           ~~~~~~~~~~~~~~~^~~~

The problem is that on Windows, GOOGLE_PREDICT_FALSE is #defined to nothing, so
the code expands to 'if ((n_rounded_down == 0))', which Clang warns about.

Clang would not have warned if the extra parentheses came from the macro,
but in this case they don't because the macro is just dropped.

Fix this by making the macros behave as an identity function instead of just
getting dropped.

This is closer to what these macros look like in stubs/port.h internally.
2015-08-26 11:32:08 -07:00
Feng Xiao
e72c751e4d Fix cmake build on linux. 2015-08-25 22:49:06 -07:00
Feng Xiao
c80f7c6f3c Merge pull request #742 from xfxyjwf/c11_compile
Fix compile issues with -std=c++11
2015-08-25 22:35:24 -07:00
Feng Xiao
d9ab86cdbf Fix compile issues with -std=c++11
This compiles with -std=c++11:
message Foo {
  map<string, Foo> value = 1;
}

This does not compile:
message Foo {
  map<int32, Foo> value = 1;
}

Needs to dig more into the underlying issue.
2015-08-25 22:20:47 -07:00
Jisi Liu
f9237d2bcd Merge pull request #741 from pherl/beta-1
fix "memory leaks" in protostream-object files.
2015-08-25 22:05:31 -07:00
Jisi Liu
0977815af2 fix "memory leaks" in protostream-object files.
Change-Id: I0aca56802d974cb03cb89c1a294f37068b5b9758
2015-08-25 22:01:12 -07:00
Jisi Liu
06c9dfd9a3 Merge pull request #740 from pherl/beta-1
Fix commandline interface file under heapcheck.
2015-08-25 21:11:58 -07:00
Jisi Liu
01e060f20e Fix commandline interface file under heapcheck.
The internal down-integrate script probably does not handle the
top level macros well. Moved the macro inside of the namespace
declrations to avoid down-integrate errors in the future.

Change-Id: I3790357f36b0204a2a26577805192a3a1e989df8
2015-08-25 20:53:19 -07:00
Feng Xiao
b192ba87f7 Merge remote-tracking branch 'origin/master' into beta-1 2015-08-25 20:24:43 -07:00
Feng Xiao
cf94f7b744 Merge pull request #726 from DouglasHeriot/msvc-noinline
Define GOOGLE_ATTRIBUTE_NOINLINE for MSVC. Workaround for VS2015 Release build compiler bug
2015-08-25 18:16:02 -07:00
Feng Xiao
5da0b46811 Merge pull request #734 from TeBoring/beta-1
Fix bugs on windows
2015-08-25 18:00:26 -07:00
Bo Yang
ff7bdad231 Fix bugs on windows 2015-08-25 17:58:48 -07:00
Jisi Liu
144ea00659 Merge branch 'beta-1' of github.com:google/protobuf into manual-merge 2015-08-25 17:03:49 -07:00
Jisi Liu
4c663d810e Update descriptor protos.
Change-Id: I74a73d3135ec1e0e4d52d741a77456b8e55f038f
2015-08-25 17:03:05 -07:00
Jisi Liu
db45aa117a Merge branch 'beta-1' of github.com:google/protobuf into manual-merge
Change-Id: I83a93fdb119a643fbc884e6ec3624493f6270370
2015-08-25 16:51:22 -07:00
Feng Xiao
cc5a1bfede Make the PARSER @Deprecated public.
(cherry-picking an intenral change).
2015-08-25 16:50:53 -07:00
Jisi Liu
56c4f57bb0 Merge branch 'gcc-c++11-fix' of https://github.com/nsuke/protobuf into beta-1
Manually merge pull request: https://github.com/google/protobuf/pull/674
that fixes the gcc C++11 build.
2015-08-25 16:32:01 -07:00
Jon Skeet
ca89a1a118 Change where we rename Descriptor.cs to DescriptorProtoFile.cs.
We now do this in protoc instead of the generation simpler.

Benefits:
- Generation script is simpler
- Detection is simpler as we now only need to care about one filename
- The embedded descriptor knows itself as "google/protobuf/descriptor.proto" avoiding dependency issues

This PR also makes the "invalid dependency" exception clearer in terms of expected and actual dependencies.
2015-08-25 14:32:28 +01:00
Feng Xiao
839b180dba Cherry-pick Java utf8 change. 2015-08-24 11:25:15 -07:00
Feng Xiao
b17ec3ca11 Down-integrate from internal code base. 2015-08-23 17:50:38 -07:00
Feng Xiao
eee38b0c01 Down-integrate from google3. 2015-08-22 18:25:48 -07:00
Tamir Duberstein
322d8939fc Remove Python 2.5 cruft 2015-08-22 12:54:31 -04:00
Jisi Liu
c3bc155ace Merge branch 'master' of github.com:google/protobuf
Change-Id: If3fb07754a734bae610d95124528e073515ac525
2015-08-21 11:44:49 -07:00
Jisi Liu
b0f661181d Down-integrate from internal branch.
Change-Id: Ieb7a2c2fbf35bc2a8fa65b915a5ecb68c83863e4
2015-08-21 11:18:45 -07:00
Douglas Heriot
5021c4d885 Define GOOGLE_ATTRIBUTE_NOINLINE for MSVC. Workaround for VS2015 Release build compiler bug.
See issue #240 - MSVC in VS2015 seems to inline a function it shouldn't. My original workaround was to disable inlining for the whole file, but I found a way to do it on just this specific function using __declspec(noinline).
Unfortunately __declspec has to go at the start of the function declaration, while __attribute in GCC can go either before or after. I had to move lots of GOOGLE_ATTRIBUTE_NOLINE to make it compile. I have not yet tested this change with GCC.

Will there be other side effects of defining this, given it wasn't previously?

I also noticed a few functions marked with both the 'inline' keyword, and GOOGLE_ATTRIBUTE_NOINLINE - huh? Is there an explanation for this, or is it an oversight?
2015-08-22 02:05:40 +10:00
Jon Skeet
0cb84ee31f Merge pull request #720 from jtattermusch/csharp_fixes
C# fix for TypeInitializer exception.
2015-08-14 22:12:02 +01:00
Jan Tattermusch
fa2fe35dec fix type initialization problem with FileDescriptor 2015-08-14 13:38:34 -07:00
Paul Yang
5c370cc55f Merge pull request #571 from thomasvl/validation_support
Add support for a file listing expected package to objc prefixes for validation.
2015-08-14 13:06:43 -07:00
Thomas Van Lenten
4e43931eaf Add support for a file listing expected package to objc prefixes for validation.
- Add a env var to pass a set of expected prefixes for validation.
- Report warnings/errors based on the expected prefixes vs. the data in the files compiled.
- Use some helpers from common directory.
2015-08-14 13:34:51 -04:00
Jon Skeet
a39ababb7c Allow public access to descriptor.proto as a dependency.
With this in place, generating APIs on github.com/google/googleapis works - previously annotations.proto failed.
Currently there's no access to the annotations (stored as extensions) but we could potentially expose those at a later date.
2015-08-13 12:01:41 +01:00