protobuf-c: updated to 1.3.2

protobuf-c (1.3.2)
* Use protobuf 3.7.1 in the Travis-CI environment.
* Fix test suite build failure on newer versions of protobuf.
* Fix proto3 repeated scalar field default packing behavior.
* Fix out-of-bounds read in scan_length_prefixed_data().
* Fix -Wdeclaration-after-statement warning in parse_oneof_member().
* Fix SIGSEGV in protobuf_c_message_check() on messages with unpopulated
  oneof member.
* Do not allow tag values of 0 in protobuf messages, as these are not
  allowed by proto2 or proto3.

protobuf-c (1.3.1)
* Restore protobuf-2.x compatibility.
* Use xenial and protobuf 3.6.1 in the Travis-CI environment.
* Convert uses of protobuf's scoped_ptr.h to C++11 std::unique_ptr, needed
  to compile against protobuf 3.6.1.
* Use AX_CXX_COMPILE_STDCXX macro to enable C++11 support in old compilers
* Add std:: to some types.
* Check the return value of int_range_lookup before using as an array index;
  it can return -1.
* Fix compilation on mingw by using explicit protoc --plugin=NAME=PATH syntax
  in Makefile.am
This commit is contained in:
adam 2020-01-17 21:09:18 +00:00
parent 585a4533ab
commit f7deb09740
11 changed files with 15 additions and 251 deletions

View file

@ -1,25 +1,21 @@
# $NetBSD: Makefile,v 1.5 2018/08/04 21:36:16 minskim Exp $
# $NetBSD: Makefile,v 1.6 2020/01/17 21:09:18 adam Exp $
DISTNAME= protobuf-c-1.3.0
PKGREVISION= 2
DISTNAME= protobuf-c-1.3.2
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=protobuf-c/}
GITHUB_TAG= v${PKGVERSION_NOREV}
GITHUB_RELEASE= v${PKGVERSION_NOREV}
MAINTAINER= wiedi@frubar.net
HOMEPAGE= https://github.com/protobuf-c/protobuf-c
COMMENT= Protocol Buffers implementation in C
LICENSE= modified-bsd
GNU_CONFIGURE= yes
USE_LIBTOOL= yes
USE_TOOLS+= pkg-config aclocal autoconf automake gmake
USE_LANGUAGES= c99 c++11
USE_LANGUAGES= c99 c++11
USE_LIBTOOL= yes
USE_TOOLS+= gmake pkg-config
GNU_CONFIGURE= yes
PKGCONFIG_OVERRIDE+= protobuf-c/libprotobuf-c.pc.in
pre-configure:
cd ${WRKSRC} && ./autogen.sh
TEST_TARGET= check
.include "../../devel/protobuf/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.2 2018/01/17 12:10:37 jperkin Exp $
# $NetBSD: buildlink3.mk,v 1.3 2020/01/17 21:09:18 adam Exp $
BUILDLINK_TREE+= protobuf-c
@ -6,7 +6,7 @@ BUILDLINK_TREE+= protobuf-c
PROTOBUF_C_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.protobuf-c+= protobuf-c>=1.1.1
BUILDLINK_ABI_DEPENDS.protobuf-c?= protobuf-c>=1.3.0nb1
BUILDLINK_ABI_DEPENDS.protobuf-c+= protobuf-c>=1.3.0nb1
BUILDLINK_PKGSRCDIR.protobuf-c?= ../../devel/protobuf-c
.include "../../devel/protobuf/buildlink3.mk"

View file

@ -1,15 +1,6 @@
$NetBSD: distinfo,v 1.6 2019/03/27 11:31:21 jperkin Exp $
$NetBSD: distinfo,v 1.7 2020/01/17 21:09:18 adam Exp $
SHA1 (protobuf-c-1.3.0.tar.gz) = b1df242c1445e2cc22708ca1889f5ce63bcbfc6c
RMD160 (protobuf-c-1.3.0.tar.gz) = 528c1ae07297990f1e3405db2e3129eef9823698
SHA512 (protobuf-c-1.3.0.tar.gz) = 52a8564c4570ce45de41f664d2c8edaa0712a5c076d6c9b48a4a1022df83ba5f2e1950823a0e91c2754d9ea9922e11d0cc86f82c23ba77e0f0c5659ed43126aa
Size (protobuf-c-1.3.0.tar.gz) = 123153 bytes
SHA1 (patch-protoc-c_c__field.cc) = 79f649fcc6deeda7f86e4ba83f7e279b3aef2070
SHA1 (patch-protoc-c_c__field.h) = 9b6a71cb880b774a676c14783cc60bff21ebb6c3
SHA1 (patch-protoc-c_c__file.cc) = 27a9e34d34cae5f726ecef3f4d96ad6bdc9ddd9f
SHA1 (patch-protoc-c_c__file.h) = 7e7e42a56939d3cf6b23f5e53a9dd7a89e04db1b
SHA1 (patch-protoc-c_c__generator.cc) = fc5795bec0c6536713ee7043777edd10b07db9b4
SHA1 (patch-protoc-c_c__helpers.cc) = 236b1ead1a5f452cf8532507326bd6316e6c6c17
SHA1 (patch-protoc-c_c__message.cc) = f36502a761f46cb555708ef14d26e4aec5725001
SHA1 (patch-protoc-c_c__message.h) = b5f2761ab1f1f735fd0a795342b3479e6b253832
SHA1 (patch-t_generated-code2_cxx-generate-packed-data.cc) = c23e890f088e51f1ce4e96a48f1bf3ea8b0f1d3a
SHA1 (protobuf-c-1.3.2.tar.gz) = 6e486ec03e2c60305ec59d1811425f93f5b2b37e
RMD160 (protobuf-c-1.3.2.tar.gz) = b64ec1f0d062a885a8b82d58aae22ae6275b8714
SHA512 (protobuf-c-1.3.2.tar.gz) = d94d2c6f11b3e482fd3d1b8cef5b2d896ad37a679068f393d29916311deadc5b6b86f946b046d7ee49260b0223e3128e052dc76324b4a8cd6ea184d566ad9aa6
Size (protobuf-c-1.3.2.tar.gz) = 500100 bytes

View file

@ -1,15 +0,0 @@
$NetBSD: patch-protoc-c_c__field.cc,v 1.1 2018/08/04 21:36:16 minskim Exp $
https://github.com/protobuf-c/protobuf-c/pull/328
--- protoc-c/c_field.cc.orig 2017-08-05 21:41:36.000000000 +0000
+++ protoc-c/c_field.cc
@@ -189,7 +189,7 @@ void FieldGenerator::GenerateDescriptorI
FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor)
: descriptor_(descriptor),
field_generators_(
- new scoped_ptr<FieldGenerator>[descriptor->field_count()]) {
+ new std::unique_ptr<FieldGenerator>[descriptor->field_count()]) {
// Construct all the FieldGenerators.
for (int i = 0; i < descriptor->field_count(); i++) {
field_generators_[i].reset(MakeGenerator(descriptor->field(i)));

View file

@ -1,15 +0,0 @@
$NetBSD: patch-protoc-c_c__field.h,v 1.1 2018/08/04 21:36:16 minskim Exp $
https://github.com/protobuf-c/protobuf-c/pull/328
--- protoc-c/c_field.h.orig 2017-08-05 21:41:36.000000000 +0000
+++ protoc-c/c_field.h
@@ -117,7 +117,7 @@ class FieldGeneratorMap {
private:
const Descriptor* descriptor_;
- scoped_array<scoped_ptr<FieldGenerator> > field_generators_;
+ std::unique_ptr<std::unique_ptr<FieldGenerator>[] > field_generators_;
static FieldGenerator* MakeGenerator(const FieldDescriptor* field);

View file

@ -1,24 +0,0 @@
$NetBSD: patch-protoc-c_c__file.cc,v 1.1 2018/08/04 21:36:16 minskim Exp $
https://github.com/protobuf-c/protobuf-c/pull/328
--- protoc-c/c_file.cc.orig 2017-08-05 21:41:36.000000000 +0000
+++ protoc-c/c_file.cc
@@ -83,13 +83,13 @@ FileGenerator::FileGenerator(const FileD
const string& dllexport_decl)
: file_(file),
message_generators_(
- new scoped_ptr<MessageGenerator>[file->message_type_count()]),
+ new std::unique_ptr<MessageGenerator>[file->message_type_count()]),
enum_generators_(
- new scoped_ptr<EnumGenerator>[file->enum_type_count()]),
+ new std::unique_ptr<EnumGenerator>[file->enum_type_count()]),
service_generators_(
- new scoped_ptr<ServiceGenerator>[file->service_count()]),
+ new std::unique_ptr<ServiceGenerator>[file->service_count()]),
extension_generators_(
- new scoped_ptr<ExtensionGenerator>[file->extension_count()]) {
+ new std::unique_ptr<ExtensionGenerator>[file->extension_count()]) {
for (int i = 0; i < file->message_type_count(); i++) {
message_generators_[i].reset(

View file

@ -1,51 +0,0 @@
$NetBSD: patch-protoc-c_c__generator.cc,v 1.1 2018/08/04 21:36:16 minskim Exp $
https://github.com/protobuf-c/protobuf-c/pull/309
https://github.com/protobuf-c/protobuf-c/pull/328
--- protoc-c/c_generator.cc.orig 2017-08-05 21:41:36.000000000 +0000
+++ protoc-c/c_generator.cc
@@ -80,13 +80,13 @@ namespace c {
// "foo=bar,baz,qux=corge"
// parses to the pairs:
// ("foo", "bar"), ("baz", ""), ("qux", "corge")
-void ParseOptions(const string& text, vector<pair<string, string> >* output) {
- vector<string> parts;
+ void ParseOptions(const string& text, std::vector<std::pair<string, string> >* output) {
+ std::vector<string> parts;
SplitStringUsing(text, ",", &parts);
for (unsigned i = 0; i < parts.size(); i++) {
string::size_type equals_pos = parts[i].find_first_of('=');
- pair<string, string> value;
+ std::pair<string, string> value;
if (equals_pos == string::npos) {
value.first = parts[i];
value.second = "";
@@ -105,7 +105,7 @@ bool CGenerator::Generate(const FileDesc
const string& parameter,
OutputDirectory* output_directory,
string* error) const {
- vector<pair<string, string> > options;
+ std::vector<std::pair<string, string> > options;
ParseOptions(parameter, &options);
// -----------------------------------------------------------------
@@ -149,7 +149,7 @@ bool CGenerator::Generate(const FileDesc
// Generate header.
{
- scoped_ptr<io::ZeroCopyOutputStream> output(
+ std::unique_ptr<io::ZeroCopyOutputStream> output(
output_directory->Open(basename + ".h"));
io::Printer printer(output.get(), '$');
file_generator.GenerateHeader(&printer);
@@ -157,7 +157,7 @@ bool CGenerator::Generate(const FileDesc
// Generate cc file.
{
- scoped_ptr<io::ZeroCopyOutputStream> output(
+ std::unique_ptr<io::ZeroCopyOutputStream> output(
output_directory->Open(basename + ".c"));
io::Printer printer(output.get(), '$');
file_generator.GenerateSource(&printer);

View file

@ -1,63 +0,0 @@
$NetBSD: patch-protoc-c_c__helpers.cc,v 1.1 2018/08/04 21:36:16 minskim Exp $
https://github.com/protobuf-c/protobuf-c/pull/309
https://github.com/protobuf-c/protobuf-c/pull/328
--- protoc-c/c_helpers.cc.orig 2017-08-05 21:41:36.000000000 +0000
+++ protoc-c/c_helpers.cc
@@ -177,7 +177,7 @@ string ToCamel(const string &name) {
}
string FullNameToLower(const string &full_name) {
- vector<string> pieces;
+ std::vector<string> pieces;
SplitStringUsing(full_name, ".", &pieces);
string rv = "";
for (unsigned i = 0; i < pieces.size(); i++) {
@@ -188,7 +188,7 @@ string FullNameToLower(const string &ful
return rv;
}
string FullNameToUpper(const string &full_name) {
- vector<string> pieces;
+ std::vector<string> pieces;
SplitStringUsing(full_name, ".", &pieces);
string rv = "";
for (unsigned i = 0; i < pieces.size(); i++) {
@@ -199,7 +199,7 @@ string FullNameToUpper(const string &ful
return rv;
}
string FullNameToC(const string &full_name) {
- vector<string> pieces;
+ std::vector<string> pieces;
SplitStringUsing(full_name, ".", &pieces);
string rv = "";
for (unsigned i = 0; i < pieces.size(); i++) {
@@ -214,7 +214,7 @@ void PrintComment (io::Printer* printer,
{
if (!comment.empty())
{
- vector<string> comment_lines;
+ std::vector<string> comment_lines;
SplitStringUsing (comment, "\r\n", &comment_lines);
printer->Print ("/*\n");
for (int i = 0; i < comment_lines.size(); i++)
@@ -503,8 +503,8 @@ void SplitStringToIteratorUsing(const st
void SplitStringUsing(const string& full,
const char* delim,
- vector<string>* result) {
- std::back_insert_iterator< vector<string> > it(*result);
+ std::vector<string>* result) {
+ std::back_insert_iterator< std::vector<string> > it(*result);
SplitStringToIteratorUsing(full, delim, it);
}
@@ -559,7 +559,7 @@ static int CEscapeInternal(const char* s
}
string CEscape(const string& src) {
const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
- scoped_array<char> dest(new char[dest_length]);
+ std::unique_ptr<char[]> dest(new char[dest_length]);
const int len = CEscapeInternal(src.data(), src.size(),
dest.get(), dest_length, false);
GOOGLE_DCHECK_GE(len, 0);

View file

@ -1,21 +0,0 @@
$NetBSD: patch-protoc-c_c__message.cc,v 1.1 2018/08/04 21:36:16 minskim Exp $
https://github.com/protobuf-c/protobuf-c/pull/328
--- protoc-c/c_message.cc.orig 2017-08-05 21:41:36.000000000 +0000
+++ protoc-c/c_message.cc
@@ -83,11 +83,11 @@ MessageGenerator::MessageGenerator(const
: descriptor_(descriptor),
dllexport_decl_(dllexport_decl),
field_generators_(descriptor),
- nested_generators_(new scoped_ptr<MessageGenerator>[
+ nested_generators_(new std::unique_ptr<MessageGenerator>[
descriptor->nested_type_count()]),
- enum_generators_(new scoped_ptr<EnumGenerator>[
+ enum_generators_(new std::unique_ptr<EnumGenerator>[
descriptor->enum_type_count()]),
- extension_generators_(new scoped_ptr<ExtensionGenerator>[
+ extension_generators_(new std::unique_ptr<ExtensionGenerator>[
descriptor->extension_count()]) {
for (int i = 0; i < descriptor->nested_type_count(); i++) {

View file

@ -1,19 +0,0 @@
$NetBSD: patch-protoc-c_c__message.h,v 1.1 2018/08/04 21:36:16 minskim Exp $
https://github.com/protobuf-c/protobuf-c/pull/328
--- protoc-c/c_message.h.orig 2017-08-05 21:41:36.000000000 +0000
+++ protoc-c/c_message.h
@@ -126,9 +126,9 @@ class MessageGenerator {
const Descriptor* descriptor_;
string dllexport_decl_;
FieldGeneratorMap field_generators_;
- scoped_array<scoped_ptr<MessageGenerator> > nested_generators_;
- scoped_array<scoped_ptr<EnumGenerator> > enum_generators_;
- scoped_array<scoped_ptr<ExtensionGenerator> > extension_generators_;
+ std::unique_ptr<std::unique_ptr<MessageGenerator>[] > nested_generators_;
+ std::unique_ptr<std::unique_ptr<EnumGenerator>[] > enum_generators_;
+ std::unique_ptr<std::unique_ptr<ExtensionGenerator>[] > extension_generators_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator);
};

View file

@ -1,15 +0,0 @@
$NetBSD: patch-t_generated-code2_cxx-generate-packed-data.cc,v 1.1 2019/03/27 11:31:21 jperkin Exp $
Upstream fix https://github.com/protobuf-c/protobuf-c/pull/342
--- t/generated-code2/cxx-generate-packed-data.cc.orig 2017-08-05 21:41:36.000000000 +0000
+++ t/generated-code2/cxx-generate-packed-data.cc
@@ -998,7 +998,7 @@ static void dump_test_packed_repeated_en
static void dump_test_unknown_fields (void)
{
EmptyMess mess;
- const google::protobuf::Message::Reflection *reflection = mess.GetReflection();
+ const google::protobuf::Reflection *reflection = mess.GetReflection();
google::protobuf::UnknownFieldSet *fs = reflection->MutableUnknownFields(&mess);
#if GOOGLE_PROTOBUF_VERSION >= 2001000