Commit Graph

2517 Commits

Author SHA1 Message Date
Jon Skeet
7909b2edeb Merge pull request #659 from jskeet/fix-frozen
Remove a few hangers-on from frozenness.
2015-07-30 13:35:55 +01:00
Jon Skeet
dea15a7ca4 Generated code from previous commit. 2015-07-30 13:16:00 +01:00
Jon Skeet
f03271665f More freezing tidy-up; generated code in next commit. 2015-07-30 13:15:45 +01:00
Jon Skeet
3b2fe97b6f Minor bits of left-over frozenness. 2015-07-30 13:07:50 +01:00
Jon Skeet
7a0effb9e9 Merge pull request #654 from jtattermusch/csharp_hide_freeze
Remove the C# Freeze API
2015-07-30 09:47:38 +01:00
Jon Skeet
9cfea1d6f6 Merge pull request #655 from jtattermusch/csharp_expose_more_info_about_service
Expose IsClientStreaming and IsServerStreaming in MethodDescriptor
2015-07-30 06:46:53 +01:00
Jan Tattermusch
7ec023acf4 regenerate code 2015-07-29 20:26:20 -07:00
Jan Tattermusch
3783d9a8ad remove the freeze API 2015-07-29 20:26:20 -07:00
Jan Tattermusch
fa29148137 add IsClientStreaming and IsServerStreaming to MethodDescriptor 2015-07-29 18:48:54 -07:00
Paul Yang
c6dffbcb4f Merge pull request #652 from TeBoring/objectivec
Move the definition of GOOGLE_FALLTHROUGH_INTENDED to port.h
2015-07-29 15:20:47 -07:00
teboring
5da3fb0666 Move the definition of GOOGLE_FALLTHROUGH_INTENDED to port.h 2015-07-29 14:34:52 -07:00
Tom Hughes
93ba933363 Remove unused private fields.
Fixes compilation when -Wunused-private-field is enabled (e.g., when
using -Wall).
2015-07-29 14:27:05 -07:00
Feng Xiao
add3e8df57 Merge pull request #651 from litinglin/master
On x64 MSVC platform, macro PROTOBUF_LITTLE_ENDIAN won't be set
2015-07-29 13:47:09 -07:00
Tom Hughes
56327ecc02 Fix compilation error when using C++11.
The issue occurs when the template type deduction results in NodeType
being const.

Shortened version of compile error:

no matching function for call to 'operator new'
      new (p) NodeType(std::forward<Args>(args)...);

candidate function not viable: no known conversion from 'const
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > *' to 'void *' for 2nd argument; take the
address of the argument with &
inline __attribute__ ((__visibility__("hidden"), __always_inline__))
void* operator new (std::size_t, void* __p) noexcept {return __p;}
2015-07-29 13:00:06 -07:00
LitingLin
67d51ac4f8 Windows is always little-endian. 2015-07-30 02:35:39 +08:00
LitingLin
224010c775 A bug about PROTOBUF_LITTLE_ENDIAN remain undefined on MSVC x64 2015-07-30 01:51:11 +08:00
Jan Tattermusch
74810c6ae3 Merge pull request #638 from jskeet/portable
First attempt at using profile 259 for Google.Protobuf.
2015-07-29 09:32:55 -07:00
Tom Hughes
6d72d12575 Set cmake include directories on library targets.
cmake targets that depend on these libraries will automatically have
these include directories.
2015-07-28 16:18:35 -07:00
Tom Hughes
60c5222287 Include pthread.h when using GOOGLE_PROTOBUF_NO_THREADLOCAL.
When GOOGLE_PROTOBUF_NO_THREADLOCAL is defined, classes that depend on
pthread functions are included (such as ThreadLocalStorage).
2015-07-28 16:16:16 -07:00
Jon Skeet
d82ebe48e1 Update the readme file to indicate supported platforms 2015-07-28 10:23:11 +01:00
Jon Skeet
9ccc83990d Humbug - previous commit didn't include project file changes :( 2015-07-28 09:01:13 +01:00
Jon Skeet
0802d56fcd Tweaks to Profile259 support
- Fix nupec paths
- Remove an obsolete part of the JSON build
- Add documentation and tests to reflection extension methods, and improve implementations
2015-07-28 08:16:50 +01:00
Paul Yang
f642c5cfdd Merge pull request #635 from TeBoring/objectivec
Update minimal ios and osx version for deployment.
2015-07-27 11:43:11 -07:00
Feng Xiao
69d660b39c Merge pull request #642 from nico/unused
Remove two unused functions.
2015-07-27 11:39:27 -07:00
Bo Yang
d58e95bc10 Update minimal ios and osx version for deployment. 2015-07-27 10:54:44 -07:00
Jon Skeet
0dbd5ec80d First attempt at using profile 259 for Google.Protobuf.
This requires .NET 4.5, and there are a few compatibility changes required around reflection.
Creating a PR from this to see how our CI systems handle it. Will want to add more documentation,
validation and probably tests before merging.

This is in aid of issue #590.
2015-07-27 07:47:50 +01:00
Nico Weber
58b2decb7b Remove two unused functions. 2015-07-25 19:37:52 -07:00
Jon Skeet
edff88886b Merge pull request #641 from jtattermusch/csharp_descriptor_database
Expose original binary data for file descriptor
2015-07-25 07:13:08 +01:00
Jan Tattermusch
3b8c83eff1 expose original binary data for filedescriptor 2015-07-24 20:27:35 -07:00
Jon Skeet
bea87743e0 Merge pull request #634 from jskeet/reflection2
Reflection part 2 - for discussion
2015-07-23 06:50:23 +01:00
Jon Skeet
c1c6b2d0d5 Implemented Jan's suggestion of FieldCollection, replacing FieldAccessorCollection.
I think Jan was actually suggesting keeping both, but that feels redundant to me. The test diff is misleading here IMO, because I wouldn't expect real code using reflection to use several accessors one after another like this, unless it was within a loop. Evidence to the contrary would be welcome :)

This change also incidentally goes part way to fixing the issue of the JSON formatter not writing out the fields in field number order - with this change, it does except for oneofs, which we can fix in a follow-up change.

I haven't actually added a test with a message with fields deliberately out of order - I'm happy to do so though. It feels like it would make sense to be in google/src/protobuf, but it's not entirely clear what the rules of engagement are for adding new messages there. (unittest_proto3.proto?)
2015-07-22 20:13:38 +01:00
Jon Skeet
5e0cfc9a47 Added newlines 2015-07-22 20:13:37 +01:00
Jon Skeet
20bf6a563a First pass at making field access simpler.
This is definitely not ready to ship - I'm "troubled" by the disconnect between a list of fields in declaration order, and a mapping of field accessors by field number/name. Discussion required, but I find that easier when we've got code to look at :)
2015-07-22 20:13:37 +01:00
Jan Tattermusch
7b5c396799 Merge pull request #625 from jskeet/reflection-refactor
Reflection refactor
2015-07-22 10:36:06 -07:00
Jon Skeet
43d64b4f54 Fix typo in Makefile.am 2015-07-22 14:32:27 +01:00
Jon Skeet
e2368c9022 Fix attribute mistake and regenerate code. 2015-07-22 13:47:16 +01:00
Jon Skeet
17fd398e1a Fix file lists for C# 2015-07-22 11:40:52 +01:00
Jon Skeet
47bf49b9fa Generated code for previous commit. 2015-07-22 11:39:38 +01:00
Jon Skeet
4668c3dc39 Remove the usage of attributes for field/method discovery.
Instead, introduce GeneratedCodeInfo which passes in what we need, and adjust the codegen to take account of this.
2015-07-22 11:38:22 +01:00
Paul Yang
1647e63c57 Merge pull request #602 from TeBoring/objectivec
Add packTo and unpackFrom in google.protobuf.Any.
2015-07-21 20:50:20 -07:00
TeBoring
7366efd81e Add packFrom, unpackTo and is in google.protobuf.Any.
The previous two methods make it easy to transform between any and normal message.
unPackeTo will throw error if the type url in any doesn't match the type of the message to be transformed to.
is checks any's type url matches the give GPBMessage type.
2015-07-21 15:45:02 -07:00
Jon Skeet
8d115298c7 Fix comment typo 2015-07-21 12:59:42 +01:00
Jon Skeet
96cffaa8e3 Generated code changes following previous commit. 2015-07-21 12:59:41 +01:00
Jon Skeet
53c399a1d6 Revamp to reflection.
Changes in brief:
1. Descriptor is now the entry point for all reflection.
2. IReflectedMessage has gone; there's now a Descriptor property in IMessage, which is explicitly implemented (due to the static property).
3. FieldAccessorTable has gone away
4. IFieldAccessor and OneofFieldAccessor still exist; we *could* put the functionality straight into FieldDescriptor and OneofDescriptor... I'm unsure about that.
5. There's a temporary property MessageDescriptor.FieldAccessorsByFieldNumber to make the test changes small - we probably want this to go away
6. Discovery for delegates is now via attributes applied to properties and the Clear method of a oneof

I'm happy with 1-3.
4 I'm unsure about - feedback welcome.
5 will go away
6 I'm unsure about, both in design and implementation. Should we have a ProtobufMessageAttribute too? Should we find all the relevant attributes in MessageDescriptor and pass them down, to avoid an O(N^2) scenario?

Generated code changes coming in the next commit.
2015-07-21 12:59:40 +01:00
Jon Skeet
2ee4b56655 Merge pull request #629 from google/master
Integrate changes from upstream/master into csharp-experimental
2015-07-21 12:58:43 +01:00
Jan Tattermusch
c792db5d08 Merge pull request #628 from jtattermusch/csharp_addressbook_update
C# addressbook update
2015-07-20 18:54:34 -07:00
Jan Tattermusch
353b7a9985 Merge pull request #627 from jtattermusch/addressbook_proto3
Update addressbook.proto and examples code to proto3
2015-07-20 18:54:27 -07:00
Jisi Liu
d119a27549 Merge pull request #621 from nico/staticass
Let GOOGLE_COMPILE_ASSERT use static_assert if available.
2015-07-20 17:36:00 -07:00
Jan Tattermusch
43b17376f7 update addressbook example 2015-07-20 16:00:26 -07:00
Jan Tattermusch
352690efc7 regenerate Addressbook.cs 2015-07-20 15:53:19 -07:00