[protobuf] Re: protoc plugin in Python and unknown extension options

2017-04-28 Thread 'Josh Haberman' via Protocol Buffers
Have you tried just using the FieldDescriptor? I suspect that will work, as it's what some of our own code does. For example see: https://github.com/google/protobuf/blob/master/python/google/protobuf/text_format.py#L819 On Monday, April 24, 2017 at 8:19:23 PM UTC-7, Robert Dyer wrote: > > I'm

[protobuf] Re: Extended field options

2017-04-28 Thread 'Josh Haberman' via Protocol Buffers
If the bitstring has a maximum length that is smaller than 32 or 64 bits, you could declare it as an integer type. Otherwise you might want to declare it as a "bytes" type. On Tuesday, April 18, 2017 at 1:34:01 AM UTC-7, oberon.me...@gmail.com wrote: > > Hello everyone > I am new to protobuf

[protobuf] protobuf::internal::GetEmptyStringAlreadyInited(): Assertion `empty_string_ != __null' failed

2017-04-28 Thread Jai Asher
Hi, I am trying to build and run a project using protobuf-lite, my library ( libMaster.so) links to another library (libpulsar.so). *Scenario 1 -* both libraries use protobuf classes. libpulsar.so includes static library libprotobuf-lite.a but is built with -fvisibility=hidden

[protobuf] Re: Linking errors when compiling protobuff 2.5.0 on linux

2017-04-28 Thread 'Josh Haberman' via Protocol Buffers
I don't think we support building with -fvisibility=hidden. That said, it might be a simple fix. You could try tweaking the code in base/port.h according to the suggestions here: https://gcc.gnu.org/wiki/Visibility If you got it to work I think we would welcome a PR on GitHub. On Friday,

Re: [protobuf] new protoc keywords?

2017-04-28 Thread 'Josh Haberman' via Protocol Buffers
I agree with Josh. It is very unlikely that we would introduce new keywords for defining a different kind of service. On Wednesday, April 26, 2017 at 12:45:29 PM UTC-7, Josh Humphries wrote: > > I think the right approach to something like this would be to use the > existing service definition

[protobuf] Re: Linking error

2017-04-28 Thread 'Josh Haberman' via Protocol Buffers
Those functions are marked "inline", so the compiler should not be emitting references to them. Do you have any unusual inlining settings on your compiler/project? On Friday, April 28, 2017 at 3:39:59 AM UTC-7, dbbrealtimesoftw...@gmail.com wrote: > > Hi, > I am starting to use the protobuf

[protobuf] Re: How to convert message to its extend message?

2017-04-28 Thread 'Josh Haberman' via Protocol Buffers
There is no way to do that. A message does not know what message it is contained inside. Pointers only go down to submessages, not up to parent messages. On Friday, April 28, 2017 at 3:49:41 AM UTC-7, Peter Wang wrote: > > Hello, > > 1. message Foo's definition, > message Foo { > extensions

Re: [protobuf] zigzag encode and zigzag decode invoking undefined behavior

2017-04-28 Thread 'Josh Haberman' via Protocol Buffers
If you have a change that makes protobuf code not rely on undefined behavior, and also doesn't sacrifice performance, then we should merge it. Feel free to send a GitHub PR. But make sure the code is C++03 (protobuf doesn't use C++11 yet). On Tuesday, April 25, 2017 at 1:36:31 PM UTC-7,

[protobuf] Linking error

2017-04-28 Thread dbbrealtimesoftware
Hi, I am starting to use the protobuf library and have downloaded protobuff v3.2.0 for windows. I have made up my <>.proto file and generated the <>.ph.h and <>.pb.cc files, build the protobuf libraries, created dll files for VC2015, produces the proc.exe file and included everything in a

[protobuf] How to convert message to it's extend message?

2017-04-28 Thread Peter Wang
Hello, 1. message Foo's definition, message Foo { extensions 100 to 199; } 2. extension message Baz's definition, message Baz { extend Foo { optional Baz foo_ext = 124; } } 3. get the baz object's pointer by foo object use the MutableExtension() API, Foo foo; Baz* baz =

[protobuf] How to convert message to its extend message?

2017-04-28 Thread Peter Wang
Hello, 1. message Foo's definition, message Foo { extensions 100 to 199; } 2. extension message Baz's definition, message Baz { extend Foo { optional Baz foo_ext = 124; } } 3. get the baz object's pointer by foo object use the MutableExtension() API, Foo foo; Baz* baz =

[protobuf] Linking errors when compiling protobuff 2.5.0 on linux

2017-04-28 Thread Taw Moto
Hello, I am trying to compile protobuf with very simple arguments and it does not work. CFLAGS="-fPIC -DPIC -fvisibility=hidden" CXXFLAGS="-fPIC -DPIC -fvisibility=hidden" ./configure --prefix=/USERS/test/protobuf-2.5.0/output --enable-shared --enable-static --with-pic (then make install)