9 Commits

Author SHA1 Message Date
Ilya Lipnitskiy
7df109917a
protoc-c: add c_package option
This option allows to override the top-level 'package' setting, or even
remove the package prefix altogether (if set to "").

Fixes #322
2021-03-21 21:11:51 -07:00
Ilya Lipnitskiy
0e060260f0
protoc-c: add custom options support 2021-03-21 20:28:33 -07:00
Adam Cozzette
3d2ed0d410 Updated the generator to fully qualify std::string
The protobuf common.h header currently has a "using std::string;"
statement that pulls std::string into the google::protobuf namespace:
ce66f6047d/src/google/protobuf/stubs/common.h (L195)

I plan to delete that line soon. To keep protobuf-c working, this commit
updates the generator to fully qualify std::string.
2020-10-16 16:45:21 -07:00
Robert Edmonds
582cad8bff Fix namespace errors when compiled with latest protobuf
The protobuf project removed "using namespace std" namespace pollution
from their stubs/common.h header file. This caused build failures for us
since we relied on their namespace pollution.

This commit updates protobuf-c to convert:

 'map' → 'std::map'
 'set' → 'std::set'
 'back_insert_iterator' → 'std::back_insert_iterator'
2017-07-29 18:52:28 -04:00
Paolo Borelli
8194f4d91a proto3 support
This is a first cut at adding proto3 support.

As far as I understand protobuf-c already has pretty much everything
needed once it is built using a new version of protobuf itself.
The only missing thing is that in proto3 all fields are optional and
having to manually set has_foo is inconvenient.

This patch special cases the proto3 syntax files so that structs for the
bytes, enum and primitive fields do not emit the has_ field.

It also adds PROTOBUF_C_LABEL_NONE to the label enum that is used for
proto3 fields. When a fields has this label, the quantifier is not
consulted and instead the field is packed/unpacked depending on
whether it has a value different from NULL/0.
2016-10-30 10:06:52 +01:00
Ilya Lipnitskiy
9db84a3b90 protoc-c: Implement oneofs 2014-11-19 23:07:23 -08:00
Robert Edmonds
23c9b03ea7 update copyright and license statements throughout
per https://code.google.com/p/protobuf/source/detail?r=50, the license
on google-originated protobuf code was switched from Apache-2.0 to
BSD-3-Clause (so-called "New BSD" license). update any of the google
license statements to use this new license.

per email with dave, drop the third clause on his BSD-3-Clause license,
so this now becomes BSD-2-Clause.

make sure to use consistent indentation and wrapping throughout.
2013-11-18 20:25:34 -05:00
Robert Edmonds
653c04ea2c protoc-c/: fix include paths 2013-11-16 17:11:48 -05:00
Robert Edmonds
bbed775dae compiler/ -> protoc-c/ 2013-11-16 15:48:12 -05:00