Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package protobuf-c for openSUSE:Factory checked in at 2023-12-28 22:55:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/protobuf-c (Old) and /work/SRC/openSUSE:Factory/.protobuf-c.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "protobuf-c" Thu Dec 28 22:55:02 2023 rev:28 rq:1135298 version:1.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/protobuf-c/protobuf-c.changes 2023-08-30 10:20:48.472843021 +0200 +++ /work/SRC/openSUSE:Factory/.protobuf-c.new.28375/protobuf-c.changes 2023-12-28 22:55:12.132713017 +0100 @@ -1,0 +2,11 @@ +Wed Dec 27 11:32:24 UTC 2023 - Dirk Müller <[email protected]> + +- update to 1.5.0: + * Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR + * remove deprecated functionality + * Avoid "unused variable" compiler warning + * Update autotools + * Support for new Google protobuf 22.x, 23.x releases + * Remove protobuf 2.x support + +------------------------------------------------------------------- Old: ---- protobuf-c-1.4.1.tar.gz New: ---- protobuf-c-1.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ protobuf-c.spec ++++++ --- /var/tmp/diff_new_pack.8XIvag/_old 2023-12-28 22:55:12.632731271 +0100 +++ /var/tmp/diff_new_pack.8XIvag/_new 2023-12-28 22:55:12.636731417 +0100 @@ -19,7 +19,7 @@ %define sover 1 Name: protobuf-c -Version: 1.4.1 +Version: 1.5.0 Release: 0 Summary: C bindings for Google's Protocol Buffers License: BSD-3-Clause @@ -33,9 +33,7 @@ BuildRequires: libtool BuildRequires: make BuildRequires: pkgconfig -# not compatible with v22 due to https://protobuf.dev/news/2022-08-03/#cpp-changes -# see https://github.com/protobuf-c/protobuf-c/issues/544 -BuildRequires: (protobuf-devel >= 2.6.0 with protobuf-devel < 22) +BuildRequires: protobuf-devel >= 22 %description This package provides a code generator and runtime libraries to use Protocol @@ -90,7 +88,6 @@ %_libdir/libprotobuf-c.so.%sover.* %files -n libprotobuf-c-devel -%doc ChangeLog TODO %dir %_includedir/protobuf-c %dir %_includedir/google %dir %_includedir/google/protobuf-c ++++++ protobuf-c-1.4.1.tar.gz -> protobuf-c-1.5.0.tar.gz ++++++ ++++ 3167 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/ChangeLog new/protobuf-c-1.5.0/ChangeLog --- old/protobuf-c-1.4.1/ChangeLog 2022-07-11 03:33:59.000000000 +0200 +++ new/protobuf-c-1.5.0/ChangeLog 1970-01-01 01:00:00.000000000 +0100 @@ -1,564 +0,0 @@ -protobuf-c (1.4.1) - - [ Robert Edmonds ] - * Release 1.4.1 - - [ Todd C. Miller ] - * Only shift unsigned values to avoid implementation-specific behavior - (#506, #508). - * Fix regression with zero-length messages introduced in protobuf-c PR 500. - * Fix a clang analyzer 14 warning about a possible NULL deref (#512, #514). - - [ steed717 ] - * Fix unsigned integer overflow (#499, #513). - -protobuf-c (1.4.0) - - [ Robert Edmonds ] - * Release 1.4.0. - - [ Ilya Lipnitsky ] - * c_message.cc: Resolve name conflict between certain enums and oneofs - (#427). - * protobuf-c.h: Fix Windows DLL export issue with the - protobuf_c_empty_string symbol (#428). - * Standardize pkg-config for use by autotools and cmake, fix cmake tests - (#425). - * protobuf-c.c: Cast %lu args to unsigned long int (#429). - * protoc-c: Remove leading underscores from structs (#430). - * protoc-c: Fix shared lib build on windows, migrate from Travis CI to - GitHub Actions (#459). - * protobuf-c: Don't use ProtobufCWireType internally (#463). - * protoc-c: Add custom options support (#466). - * protobuf-c.c: Fix packed repeated bool parsing (#467). - - [ Markus Engel ] - * Pack nested messages inline (#431). - - [ Daniel Axtens ] - * Travis CI: Test on other platforms (#438). - - [ Adam Cozzette ] - * Update the generator to fully qualify std::string (#443). - - [ Piotr Pietraszkiewicz ] - * Install MSVC debug symbols alongside the protobuf-c.lib file (#456). - - [ ihsinme ] - * Fix invalid unsigned arithmetic (#455). - - [ Wolfram Rösler ] - * Avoid "unused function parameter" compiler warning (#453). - -protobuf-c (1.3.3) - - [ Robert Edmonds ] - * Release 1.3.3. - - * Fix build failure on protobuf 2.x (#398). - - [ msshapira ] - * CMake: Fix support for MSVC static build (#350). - - [ Adam Cozzette ] - * Fix some test assertions in test-generated-code2.c (#392). - - [ Ilya Lipnitskiy ] - * protobuf-c.c: Make zigzag encoding more compact (#400). - - [ Markus Engel ] - * CMake: Fix endianness check. - -protobuf-c (1.3.2) - - [ Robert Edmonds ] - * Release 1.3.2. - - * Use protobuf 3.7.1 in the Travis-CI environment (#368). - - * Fix test suite build failure on newer versions of protobuf (#369). - - [ Ilya Lipnitskiy ] - * Fix proto3 repeated scalar field default packing behavior (#330, #377). - - [ Adam Cozzette ] - * Fix out-of-bounds read in scan_length_prefixed_data() (#375, #376). - - [ Jurriaan Bremer ] - * Fix -Wdeclaration-after-statement warning in parse_oneof_member() (#360). - - [ Hayri Ugur Koltuk ] - * Fix SIGSEGV in protobuf_c_message_check() on messages with unpopulated - oneof members (#358). - - [ Italo Guerrieri ] - * Do not allow tag values of 0 in protobuf messages, as these are not - allowed by proto2 or proto3 (#299). - -protobuf-c (1.3.1) - - [ Robert Edmonds ] - * Release 1.3.1. - - * Restore protobuf-2.x compatibility (#284, #285). - - * Use xenial and protobuf 3.6.1 in the Travis-CI environment (#332). - - * Convert uses of protobuf's scoped_ptr.h to C++11 std::unique_ptr, needed - to compile against protobuf 3.6.1 (#320, #333). - - * Use AX_CXX_COMPILE_STDCXX macro to enable C++11 support in old compilers - (#312, #317, #327, #334). - - [ Fredrik Gustafsson ] - * Add std:: to some types (#294, #305, #309). - - [ Sam Collinson ] - * Check the return value of int_range_lookup before using as an array index; - it can return -1 (#315). - - [ Matthias Dittrich ] - * Fix compilation on mingw by using explicit protoc --plugin=NAME=PATH syntax - in Makefile.am (#289, #290). - -protobuf-c (1.3.0) - - [ Robert Edmonds ] - * Release 1.3.0. - - * Add test case for the issue in #220 (#254). - - * Fix issue #251, "Bad enums with multiple oneofs" (#256). - - * Add warning flags to my_CFLAGS (#257). - - * Fix namespace errors when compiled with latest protobuf (#280). - - * Bump minimum required header version for proto3 syntax (#282). - - [ Paolo Borelli ] - * Turn the compiler into a protoc plugin (#206). This allows the protobuf-c - compiler to be invoked as "protoc --c_out=...". For backwards - compatibility, we still ship a protoc-c command, but it's a symlink to the - protoc-gen-c binary. - - * proto3 support (#228). - - * Remove leftover FIXME comment (#258). - - * Fix proto3 "is zeroish" evaluation (#264). - - * Small cleanup in oneof handling (#265). - - * Rework is_zeroish one more time (#267). - - * proto3: make strings default to "" instead of NULL (#274). - - [ Tomek Wasilczyk ] - * Fix -Wsign-compare warnings (#213). - - * Fix ISO C90 -Wdeclaration-after-statement warnings (#214). - - * Fix bigendian -Wunused-label warning (#215). - - [ Ilya Lipnitsky ] - * protoc-c/c_message.cc: Force int size on oneof enums (#221). Fixes wrong - enum generation and handling for onceof cases (#220). - - [ Adnan ] - * Fix cmake build if built as part of an external project (#231). - - [ Gregory Detal ] - * Remove .pb.{cc,h} in distdir instead of top_distdir in order to prevent - removing files from other projects when protobuf-c is included as an - autotools subproject (#232). - - [ Ben Farnham ] - * Relax autoconf constraint from v2.64 to v2.63 so that it works on older - Linux distros (#233). - - [ Thomas Köckerbauer ] - * rm argument fix for Solaris (#234). - - * Add 'const' qualifier to 'init_value' variable in generated files (#236). - - [ Richard Kettlewell ] - * Document and extend the effect of passing NULL to ..._free_unpacked - functions (#255). - - [ Alex Milich ] - * CMake: Workaround for static builds that use MSVC (#243). - - [ Josh Junon ] - * CMake: Allow protobuf-c to be included via include_subdirectory (#245). - - [ Alexei Kasatkin ] - * CMake: Windows fixes (#266). - -protobuf-c (1.2.1) - - [ Robert Edmonds ] - * Release 1.2.1. - - [ Paolo Borelli ] - * protoc-c: Generate code that uses the universal zero initializer {0} when - initializing a oneof union (#187, #205). - -protobuf-c (1.2.0) - - [ Robert Edmonds ] - * Release 1.2.0. - - [ Ilya Lipnitsky ] - * Implement the "optimize_for = CODE_SIZE" option (#183). - - * Eliminate undefined behavior in zigzag functions (#198). - - * Pack negative enum values correctly (#199). - - [ Peter Leschev ] - * Fix protobuf_c_message_get_packed_size() on 16-bit systems (#196, #197). - - [ Diego Elio Pettenò ] - * Update link to Autotools Mythbuster to canonical site (#201). - - [ Zex Li ] - * Skip test suite when cross-compiling (#184). - -protobuf-c (1.1.1) - - [ Robert Edmonds ] - * Release 1.1.1. - - * Use protobuf 2.6.1 in the Travis-CI environment. - - [ Ilya Lipnitskiy ] - * Munge C block comment delimiters in protobuf comments, preventing syntax - errors in generated header files (Issue #180, #185). - - * Add static qualifier to ProtobufCEnumValue and ProtobufCEnumValueIndex - variables in generated output. - - [ Oleg Efimov ] - * Fix -Wpointer-sign compiler diagnostics in the test suite. - - * Check for NULL pointers in protobuf_c_message_free_unpacked() - (Issue #177). - - * Exclude protoc-c and downloaded protobuf sources from Coveralls report. - - [ Andrey Myznikov ] - * Fix incorrect 'short_name' field values in ProtobufCServiceDescriptor - variables in generated output. - -protobuf-c (1.1.0) - - [ Robert Edmonds ] - * Release 1.1.0. - - [ Ilya Lipnitskiy ] - * Fix a bug when merging optional byte fields. - - * Documentation updates. - - * Implement oneof support (Issue #174). Protobuf 2.6.0 or newer is now - required to build protobuf-c. - - * Print leading comments for enum, message, and field definitions into - generated header files (Issue #175). - -protobuf-c (1.0.2) - - [ Robert Edmonds ] - * Release 1.0.2. - - [ Ilya Lipnitskiy ] - * Fix a build failure with Protobuf 2.6.0 related to aliased enum constants - (Issue #163). - - * Protobuf 2.5.0 or newer is now required to build protobuf-c (Issue #166). - This is due to the fix for #163. - - [ Alexei Kasatkin ] - * Eliminate void pointer arithmetic (Issue #167). - - * Always define PROTOBUF_C__DEPRECATED, even on compilers that are not GCC - (Issue #167). - - * Work around the lack of the 'inline' keyword in Microsoft compilers - (Issue #167). - - * Add a CMakeLists.txt file as a fallback build system for Windows - (Issue #168). - - [ Natanael Copa ] - * Fix a build failure in the test suite that occurred with a parallel make - running on a system with a large number of CPUs (Issue #156, #169). - -protobuf-c (1.0.1) - - [ Robert Edmonds ] - * Explicitly set the .data field of ProtobufCBinaryData's to NULL when - unpacking a zero length byte string (Issue #157). - -protobuf-c (1.0.0) - - [ Andrei Nigmatulin ] - * Append "u", "ull", and "ll" integer literal suffixes for uint32, uint64, - and int64 default values in generated code, in order to avoid "integer - constant is so large that it is unsigned" compiler warnings. - (Issue #136.) - - * Revert the problematic hash-based required field detection. - (Related to Issue #60, #79, #137.) - - * Replace the 'packed' member of ProtobufCFieldDescriptor with a 'flags' - word. Define flags for packed and deprecated fields. (Issue #138.) - - [ Dave Benson ] - * Treat a "length-prefixed" wire-type message for a repeated field as - packed-repeated whenever it makes sense (for all types other than - messages, strings, and bytes). - - * Switch to New BSD license. - - * Add protobuf_c_message_check(). - - * Compile error in packing 64-bit versions on some platforms - (srobbins99: Issue #68 Comment 1). - - * Fix for memory error if the required-field check fails. See Issue #63 - for demo (w/ nice test case by dror.harari). - - * Add PROTOBUF_C_{MAJOR,MINOR} for compile-time checks and - protobuf_c_{major,minor} for checks about the running library - (Issue #53). - - * Use a small constant-size hash-table instead of alloca() for detecting - required fields, and it also prevents us from using too much stack, etc. - (Related to Issue #60, #79). - - * Add a macro to ensure enums are the size of ints (Issue #69). - - [ Ilya Lipnitskiy ] - * Travis-CI integration. - - * Add source .proto filename to generated files. - - * Add protobuf-c version to protoc-c --version output (Issue #52). - - * For embedded submessage fields, merge multiple instances of the same - field, per the protobuf documentation (Issue #91). - - * Don't print unpack errors by default. - - * Optionally allow running the test suite under valgrind with ./configure - --enable-valgrind-tests. (Based on valgrind-tests.m4 from gnulib.) - - [ Kevin Lyda ] - * Autoconf portability fixes. - - * Add doxygen detection and make targets to the build system. - - * Doxygen documentation for the libprotobuf-c public API (Issue #132). - - [ Nick Galbreath ] - * Prevent possible overflow on 64-bit systems (Issue #106). - - [ Robert Edmonds ] - * Remove CMake (Issue #87). - - * Modernize the build system. - - Don't generate any diagnostics when building the build system with - modern autotools (Issue #89). - - - Use the PKG_CHECK_MODULES macro to locate protobuf. - - - Use the AC_C_BIGENDIAN macro to detect endianness, rather than custom - code. - - - Use the automake silent-rules option so the build output is actually - readable. - - - Generate our own pkg-config .pc files. - - * Reorganize the source tree. This affects the public protobuf-c header - path, which is now <protobuf-c/protobuf-c.h>. A compatibility symlink from - <google/protobuf-c/> to <protobuf-c/> has been installed so that existing - code will continue to compile. New code should at some point begin using - the new include path, i.e., "#include <protobuf-c/protobuf-c.h>" rather - than "#include <google/protobuf-c/protobuf-c.h>". - - * The RPC code has been split out into a separate project, protobuf-c-rpc. - - * Fix a potential use of an unitialized value in protobuf_c_message_unpack() - and several memory leaks in protoc-c, discovered by a commercial static code - analysis tool. - - * Bump the libprotobuf-c SONAME. - - * Begin versioning the library's symbols. (Based on ld-version-script.m4 - from gnulib.) - - * Preserve case in enum value names generated by protoc-c (Issue #129). - Reported by Oleg Efimov. - - * Add library functions protobuf_c_version() and protobuf_c_version_string() - for retrieving the version of the compiled library, and header macros - PROTOBUF_C_VERSION and PROTOBUF_C_VERSION_STRING for retrieving the - version of the header file. This replaces the interfaces for retrieving - the protobuf-c version numbers in Issue #53. - - * Add a version guard that ensures that the output of protoc-c is only - compiled against a protobuf-c header file from the exact same protobuf-c - release. - - * Add a --enable-code-coverage option to configure, which enables a - "make check-code-coverage" build target. This generates a code coverage - report and requires the lcov tool to be installed. - - * Remove the old DocBook documentation in doc/c-code-generator.{html,xml}. - Relevant material has been updated and incorporated into the Doxygen - documentation in the protobuf-c header file. - - * Remove the protobuf_c_default_allocator and protobuf_c_system_allocator - global variables from the exported library interface. All exported library - functions that need to perform dynamic memory allocation receive a - user-provided ProtobufCAllocator* parameter. If this parameter is NULL, - the system's default memory allocator will be used. - - Client code that previously passed "&protobuf_c_system_allocator" to - protobuf-c library functions taking a ProtobufCAllocator* argument should - be updated to pass "NULL" instead. - - Client code that previously overrode protobuf_c_default_allocator with - custom allocation functions and passed NULL as the ProtobufCAllocator* - argument to protobuf-c library functions should be updated to instead - enclose the custom allocation functions in a ProtobufCAllocator struct and - pass this object to protobuf-c library functions taking a - ProtobufCAllocator* parameter. - - * Update copyright and license statements throughout. The original - protobuf code released by Google was relicensed from Apache-2.0 to - BSD-3-Clause. Dave Benson also converted his license from BSD-3-Clause - to BSD-2-Clause. - - [ Tomasz Wasilczyk ] - * Don't export protobuf_c_message_init_generic() as an external symbol. - - * Don't use C++ style comments in C code. - - * Fix -Wcast-align warnings when compiled with clang. - -protobuf-c (0.15) - - make protobuf_c_message_init() into a function (Issue #49, daveb) - - Fix for freeing memory after unpacking bytes w/o a default-value. - (Andrei Nigmatulin) - - minor windows portability issues (use ProtobufC_FD) (Pop Stelian) - - --with-endianness={little,big} (Pop Stelian) - - bug setting up values of has_idle in public dispatch, - make protobuf_c_dispatch_run() use only public members (daveb) - - provide cmake support and some Windows compatibility (Nikita Manovich) - -protobuf-c (0.14) - - build fix (missing dependency in test directory) - - add generation / installation of pkg-config files. (Bobby Powers) - - support for packed repeated fields (Dave Benson) - - bug in protobuf_c_dispatch_close_fd(), which usually only - showed up in later function calls. - - support for deprecated fields -- enable a GCC warning - if a field has the "deprecated" option enabled. (Andrei Nigmatulin) - - hackery to try to avoid touching inttypes.h on windows (Issue #41) - - fix for protobuf_c_message_unpack() to issue error if any - "required" field is missing in input stream. (Andrei Nigmatulin) - -protobuf-c (0.13) - - Fix for when the number of connections gets too great in RPC. - (Leszek Swirski) (issue #32) - - Add --disable-protoc to only build libprotobuf-c (daveb) - - Bug fixes for protobuf_c_enum_descriptor_get_value_by_name() - and protobuf_c_service_descriptor_get_method_by_name() - - if descriptor->message_init != NULL, use it from unpack() - as an optimization (daveb) - - implement protobuf_c_{client,server}_set_error_handler() - -protobuf-c (0.12) - - for field names which are reserved words, use the real name - given in the protobuf-c file, not the mangled name which - is the name of the member in the C structure. (Andrei Nigmatulin) - - add protobuf_c_message_init() function; add virtual function - that implements it efficiently. (Andrei Nigmatulin) - - bug fix for sfixed32, fixed32, float wire-types on - big-endian platforms (Robert Edmonds) - - compile with the latest protobuf (the header file wire_format_inl.h - is now wire_format.h) (Robert Edmonds) - -protobuf-c (0.11) - - allow CFLAGS=-DPRINT_UNPACK_ERRORS=0 to suppress - unpack warnings from being printed at compile time (Andrei Nigmatulin) - - give error if an unknown wire-type is encountered (Andrei Nigmatulin) - - fix technically possible overflows during unpack of very - large messages (Andrei Nigmatulin) - - [UNFINISHED] windows RPC work - - use automake's "foreign" mode from within configure.ac - and add version information to the library (Robert Edmonds) - - ProtobufCServiceDescriptor::method_indices_by_name: missing - const. (Issue 21) - - Update to support new UnknownFields API. (fix by dcreager) (Issue 20) - -protobuf-c (0.10) - - build issue on platforms which don't compute library dependencies - automatically. - - fix for certain types of corrupt messages (Landon Fuller) (issue 16) - -protobuf-c (0.9) - - build issue: needed $(EXEEXT) in dependency lists for cygwin - - bug fix: protobuf_c_service_get_method_by_name() was not correct b/c - the service's methods were not sorted by name (the header file - used to incorrectly state that they were). - Now we correctly implement protobuf_c_service_get_method_by_name() - (using a bsearch indexed by separate array). - - generated source incompatibility: we added a new - member to ProtobufCServiceDescriptor (method_indices_by_name). - You will have to run the latest protobuf - to generate those structures. - - rename rpc-client's "autoretry" mechanism to "autoreconnect". - - bug fixes using TCP clients with the RPC system. - - handle allocation failures more gracefully (Jason Lunz) (issue 15) - -protobuf-c (0.8) - - Destroy function typedef for Services was omitting a "*" - - service_machgen_invoke was broken. (issue 12) - - add RPC system (BETA) - - don't segfault when packing NULL strings and messages. (issue 13) - -protobuf-c (0.7) - - memory leak: unknown fields were not being freed by free_unpacked() - - lowercase field names consistently when composing - default_value names. (issue 11) - - remove spurious semicolon (issue 10) - -protobuf-c (0.6) - - Warning suppression for -Wcast-qual and -Wshadow. - - Support for default values of all types allowed by core protobuf. - - Generate message__init functions, for when the static initializer - isn't convenient. - - add some reserved fields at the end of the various descriptors - -protobuf-c (0.5) - - License now included in major files. - - Use little-endian optimizations; fix a bug therein. - - Include 'make deb' target. - -protobuf-c (0.4) - - Update to work with protobuf 2.0.1. - -protobuf-c (0.2) -protobuf-c (0.3) - - Minor pedantic concerns about generated code. - -protobuf-c (0.1) - - Lots of test code (and bug fixes). - -protobuf-c (0.0) - - Initial release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/LICENSE new/protobuf-c-1.5.0/LICENSE --- old/protobuf-c-1.4.1/LICENSE 2022-07-11 03:33:59.000000000 +0200 +++ new/protobuf-c-1.5.0/LICENSE 2023-11-26 00:21:25.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors. +Copyright (c) 2008-2023, Dave Benson and the protobuf-c authors. All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/Makefile.am new/protobuf-c-1.5.0/Makefile.am --- old/protobuf-c-1.4.1/Makefile.am 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/Makefile.am 2023-11-26 00:21:25.000000000 +0100 @@ -107,8 +107,8 @@ $(AM_CXXFLAGS) \ $(protobuf_CFLAGS) protoc_c_protoc_gen_c_LDADD = \ - $(protobuf_LIBS) \ - -lprotoc + -lprotoc \ + $(protobuf_LIBS) protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h: @PROTOC@ $(top_srcdir)/protobuf-c/protobuf-c.proto $(AM_V_GEN)@PROTOC@ -I$(top_srcdir) --cpp_out=$(top_builddir) $(top_srcdir)/protobuf-c/protobuf-c.proto @@ -139,11 +139,13 @@ check_PROGRAMS += \ t/generated-code/test-generated-code \ t/generated-code2/test-generated-code2 \ + t/generated-code3/test-generated-code3 \ t/version/version TESTS += \ t/generated-code/test-generated-code \ t/generated-code2/test-generated-code2 \ + t/generated-code3/test-generated-code3 \ t/version/version t_generated_code_test_generated_code_SOURCES = \ @@ -159,6 +161,16 @@ t_generated_code2_test_generated_code2_LDADD = \ protobuf-c/libprotobuf-c.la +t_generated_code3_test_generated_code3_CPPFLAGS = \ + -DPROTO3 + +t_generated_code3_test_generated_code3_SOURCES = \ + t/generated-code/test-generated-code.c \ + t/test-proto3.pb-c.c + +t_generated_code3_test_generated_code3_LDADD = \ + protobuf-c/libprotobuf-c.la + noinst_PROGRAMS += \ t/generated-code2/cxx-generate-packed-data @@ -185,6 +197,9 @@ t/test-full.pb.cc t/test-full.pb.h: @PROTOC@ $(top_srcdir)/t/test-full.proto $(AM_V_GEN)@PROTOC@ -I$(top_srcdir) --cpp_out=$(top_builddir) $(top_srcdir)/t/test-full.proto +t/test-proto3.pb-c.c t/test-proto3.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/test-proto3.proto + $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test-proto3.proto + t/generated-code2/test-full-cxx-output.inc: t/generated-code2/cxx-generate-packed-data$(EXEEXT) $(AM_V_GEN)$(top_builddir)/t/generated-code2/cxx-generate-packed-data$(EXEEXT) > $(top_builddir)/t/generated-code2/test-full-cxx-output.inc @@ -193,34 +208,9 @@ t/test-full.pb-c.c t/test-full.pb-c.h \ t/test-optimized.pb-c.c t/test-optimized.pb-c.h \ t/test-full.pb.cc t/test-full.pb.h \ + t/test-proto3.pb-c.c t/test-proto3.pb-c.h \ t/generated-code2/test-full-cxx-output.inc -if BUILD_PROTO3 - -check_PROGRAMS += \ - t/generated-code3/test-generated-code3 - -TESTS += \ - t/generated-code3/test-generated-code3 - -t_generated_code3_test_generated_code3_CPPFLAGS = \ - -DPROTO3 - -t_generated_code3_test_generated_code3_LDADD = \ - protobuf-c/libprotobuf-c.la - -t_generated_code3_test_generated_code3_SOURCES = \ - t/generated-code/test-generated-code.c \ - t/test-proto3.pb-c.c - -t/test-proto3.pb-c.c t/test-proto3.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/test-proto3.proto - $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test-proto3.proto - -BUILT_SOURCES += \ - t/test-proto3.pb-c.c t/test-proto3.pb-c.h - -endif # BUILD_PROTO3 - t_version_version_SOURCES = \ t/version/version.c t_version_version_LDADD = \ @@ -278,7 +268,6 @@ t/issue251/issue251.proto # Issue #330 -if BUILD_PROTO3 check_PROGRAMS += \ t/issue330/issue330 TESTS += \ @@ -292,6 +281,8 @@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue330/issue330.proto BUILT_SOURCES += \ t/issue330/issue330.pb-c.c t/issue330/issue330.pb-c.h +EXTRA_DIST += \ + t/issue330/issue330.proto t_issue330_issue330_SOURCES += \ t/issue389/issue389.pb-c.c # Tack onto issue330 since there is no need for a separate binary here @@ -317,9 +308,6 @@ t/issue440/issue440.pb-c.c t/issue440/issue440.pb-c.h EXTRA_DIST += \ t/issue440/issue440.proto -endif # BUILD_PROTO3 -EXTRA_DIST += \ - t/issue330/issue330.proto # Issue #375 check_PROGRAMS += \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/build-cmake/CMakeLists.txt new/protobuf-c-1.5.0/build-cmake/CMakeLists.txt --- old/protobuf-c-1.4.1/build-cmake/CMakeLists.txt 2022-07-11 03:33:12.000000000 +0200 +++ new/protobuf-c-1.5.0/build-cmake/CMakeLists.txt 2023-11-26 00:21:25.000000000 +0100 @@ -1,15 +1,42 @@ SET(PACKAGE protobuf-c) SET(PACKAGE_NAME protobuf-c) -SET(PACKAGE_VERSION 1.4.1) +SET(PACKAGE_VERSION 1.5.0) SET(PACKAGE_URL https://github.com/protobuf-c/protobuf-c) SET(PACKAGE_DESCRIPTION "Protocol Buffers implementation in C") CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR) +cmake_policy(SET CMP0074 NEW) +cmake_policy(SET CMP0091 NEW) +cmake_policy(SET CMP0112 NEW) -PROJECT(protobuf-c) +PROJECT(protobuf-c C CXX) + +if (MSVC AND NOT BUILD_SHARED_LIBS) + SET(Protobuf_USE_STATIC_LIBS ON) +endif (MSVC AND NOT BUILD_SHARED_LIBS) + +FIND_PACKAGE(Protobuf REQUIRED) +file(REAL_PATH "${PROTOBUF_INCLUDE_DIR}" PROTOBUF_INCLUDE_DIR) +INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) + +find_package(absl CONFIG) + +# for static protobuf libraries include the dependencies +if (Protobuf_USE_STATIC_LIBS) + get_property(protobuf_ABSL_USED_TARGETS DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PROPERTY IMPORTED_TARGETS) + list(FILTER protobuf_ABSL_USED_TARGETS INCLUDE REGEX "absl::") + + find_package(utf8_range CONFIG) + + set(protobuf_UTF8_USED_TARGETS + $<TARGET_NAME_IF_EXISTS:utf8_range::utf8_validity> + $<TARGET_NAME_IF_EXISTS:utf8_range::utf8_range> + ) +elseif(WIN32) + set(protobuf_ABSL_USED_TARGETS $<TARGET_NAME_IF_EXISTS:absl::abseil_dll>) +endif() #options -option(BUILD_PROTO3 "BUILD_PROTO3" ON) option(BUILD_PROTOC "Build protoc-gen-c" ON) if(CMAKE_BUILD_TYPE MATCHES Debug) option(BUILD_TESTS "Build tests" ON) @@ -20,6 +47,9 @@ INCLUDE(TestBigEndian) TEST_BIG_ENDIAN(WORDS_BIGENDIAN) +include(GNUInstallDirs) + +set(PROTOBUF_C_TARGETS "protobuf-c") SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}") ADD_DEFINITIONS(-DPACKAGE_STRING="${PACKAGE_STRING}") @@ -35,6 +65,12 @@ # using Visual Studio C++ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244") + + # Allow matching protobuf runtime dependency + if(NOT BUILD_SHARED_LIBS) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") + endif(NOT BUILD_SHARED_LIBS) + ENDIF() get_filename_component(MAIN_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH) @@ -48,26 +84,23 @@ ADD_LIBRARY(protobuf-c ${PC_SOURCES}) set_target_properties(protobuf-c PROPERTIES COMPILE_PDB_NAME protobuf-c) +target_include_directories(protobuf-c + PUBLIC + $<BUILD_INTERFACE:${MAIN_DIR}> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> +) IF (MSVC AND BUILD_SHARED_LIBS) TARGET_COMPILE_DEFINITIONS(protobuf-c PRIVATE -DPROTOBUF_C_EXPORT) ENDIF (MSVC AND BUILD_SHARED_LIBS) +target_link_libraries(protobuf-c ${protobuf_ABSL_USED_TARGETS} ${protobuf_UTF8_USED_TARGETS}) +target_compile_features(protobuf-c PRIVATE cxx_std_17) INCLUDE_DIRECTORIES(${MAIN_DIR}) INCLUDE_DIRECTORIES(${MAIN_DIR}/protobuf-c) IF(BUILD_PROTOC) -INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) # for generated files - -if (MSVC AND NOT BUILD_SHARED_LIBS) - SET(Protobuf_USE_STATIC_LIBS ON) -endif (MSVC AND NOT BUILD_SHARED_LIBS) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # for generated files -FIND_PACKAGE(Protobuf REQUIRED) -INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) - -if (BUILD_PROTO3) - ADD_DEFINITIONS(-DHAVE_PROTO3) -endif() ENDIF() if (MSVC AND NOT BUILD_SHARED_LIBS) @@ -87,39 +120,77 @@ endforeach(flag_var) endif (MSVC AND NOT BUILD_SHARED_LIBS) +if(WIN32) + # Modify the environment to hint protoc where the plugin is + # prepend to PATH because github host runners have abseil dll pre-installed. + # Use %PATH% instead of actually inserting it. On Github runners the PATH is so long + # it makes the NMake generated commands to fail. + set(OS_PATH_VARIABLE "$<TARGET_FILE_DIR:protoc-gen-c>\\;%PATH%") + + if(BUILD_SHARED_LIBS) + set(OS_PATH_VARIABLE "$<TARGET_FILE_DIR:protobuf::protoc>\\;${OS_PATH_VARIABLE}") + if (TARGET absl::abseil_dll) + set(OS_PATH_VARIABLE "$<TARGET_FILE_DIR:absl::abseil_dll>\\;${OS_PATH_VARIABLE}") + endif() + endif() + +else(WIN32) + + set(OS_PATH_VARIABLE "$ENV{PATH}" ) + set(OS_PATH_VARIABLE "$<TARGET_FILE_DIR:protoc-gen-c>:${OS_PATH_VARIABLE}") + +endif(WIN32) + IF(BUILD_PROTOC) -SET(CMAKE_CXX_STANDARD 11) +SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_CXX_STANDARD_REQUIRED ON) SET(CMAKE_CXX_EXTENSIONS OFF) -ADD_CUSTOM_COMMAND(OUTPUT protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h - COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} - ARGS --cpp_out ${CMAKE_BINARY_DIR} -I${MAIN_DIR} ${MAIN_DIR}/protobuf-c/protobuf-c.proto) -FILE(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc ) -ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC} protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) -TARGET_LINK_LIBRARIES(protoc-gen-c ${PROTOBUF_PROTOC_LIBRARY} ${PROTOBUF_LIBRARY}) +add_custom_target(protoc-generated-files + COMMAND ${CMAKE_COMMAND} -E env PATH="${OS_PATH_VARIABLE}" -- ${PROTOBUF_PROTOC_EXECUTABLE} + --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I${PROTOBUF_INCLUDE_DIR} + -I${MAIN_DIR} ${MAIN_DIR}/protobuf-c/protobuf-c.proto + COMMENT Running protoc on ${MAIN_DIR}/protobuf-c/protobuf-c.proto + BYPRODUCTS protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h + SOURCES ${MAIN_DIR}/protobuf-c/protobuf-c.proto +) + +file(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc ) +add_executable(protoc-gen-c + ${PROTOC_GEN_C_SRC} + ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c/protobuf-c.pb.cc + ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c/protobuf-c.pb.h +) +add_dependencies(protoc-gen-c protoc-generated-files) +target_include_directories(protoc-gen-c + PUBLIC + $<BUILD_INTERFACE:${MAIN_DIR}> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> +) +target_link_libraries(protoc-gen-c + protobuf::libprotoc + protobuf::libprotobuf + ${protobuf_ABSL_USED_TARGETS} + ${protobuf_UTF8_USED_TARGETS} +) + +target_compile_features(protoc-gen-c PRIVATE cxx_std_17) IF (MSVC AND BUILD_SHARED_LIBS) TARGET_COMPILE_DEFINITIONS(protoc-gen-c PRIVATE -DPROTOBUF_USE_DLLS) GET_FILENAME_COMPONENT(PROTOBUF_DLL_DIR ${PROTOBUF_PROTOC_EXECUTABLE} DIRECTORY) FILE(GLOB PROTOBUF_DLLS ${PROTOBUF_DLL_DIR}/*.dll) - FILE(COPY ${PROTOBUF_DLLS} DESTINATION ${CMAKE_BINARY_DIR}) + FILE(COPY ${PROTOBUF_DLLS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) ENDIF (MSVC AND BUILD_SHARED_LIBS) -IF(CMAKE_HOST_UNIX) -ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ln -sf protoc-gen-c protoc-c - DEPENDS protoc-gen-c) -ENDIF() - FUNCTION(GENERATE_TEST_SOURCES PROTO_FILE SRC HDR) - ADD_CUSTOM_COMMAND(OUTPUT ${SRC} ${HDR} - COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} - ARGS --plugin=$<TARGET_FILE:protoc-gen-c> -I${MAIN_DIR} ${PROTO_FILE} --c_out=${CMAKE_BINARY_DIR} - DEPENDS protoc-gen-c) + ADD_CUSTOM_COMMAND(OUTPUT ${SRC} ${HDR} + COMMAND ${CMAKE_COMMAND} + ARGS -E env PATH="${OS_PATH_VARIABLE}" -- ${PROTOBUF_PROTOC_EXECUTABLE} + --plugin=$<TARGET_FILE_NAME:protoc-gen-c> -I${MAIN_DIR} ${PROTO_FILE} --c_out=${CMAKE_CURRENT_BINARY_DIR} + DEPENDS protoc-gen-c) ENDFUNCTION() - IF(BUILD_TESTS) ENABLE_TESTING() @@ -128,32 +199,37 @@ ADD_EXECUTABLE(test-generated-code ${TEST_DIR}/generated-code/test-generated-code.c t/test.pb-c.c t/test.pb-c.h ) TARGET_LINK_LIBRARIES(test-generated-code protobuf-c) - ADD_CUSTOM_COMMAND(OUTPUT t/test-full.pb.cc t/test-full.pb.h - COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} - ARGS --cpp_out ${CMAKE_BINARY_DIR} -I${MAIN_DIR} ${TEST_DIR}/test-full.proto) + COMMAND ${CMAKE_COMMAND} + ARGS -E env PATH="${OS_PATH_VARIABLE}" -- ${PROTOBUF_PROTOC_EXECUTABLE} + --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I${MAIN_DIR} ${TEST_DIR}/test-full.proto +) GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full.pb-c.h) ADD_EXECUTABLE(cxx-generate-packed-data ${TEST_DIR}/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) -TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${PROTOBUF_LIBRARY}) +TARGET_LINK_LIBRARIES(cxx-generate-packed-data + ${PROTOBUF_LIBRARY} + ${protobuf_ABSL_USED_TARGETS} + ${protobuf_UTF8_USED_TARGETS} +) IF (MSVC AND BUILD_SHARED_LIBS) TARGET_COMPILE_DEFINITIONS(cxx-generate-packed-data PRIVATE -DPROTOBUF_USE_DLLS) ENDIF (MSVC AND BUILD_SHARED_LIBS) -FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/t/generated-code2) +FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/t/generated-code2) ADD_CUSTOM_COMMAND(OUTPUT t/generated-code2/test-full-cxx-output.inc - COMMAND ${CMAKE_BINARY_DIR}/cxx-generate-packed-data ">t/generated-code2/test-full-cxx-output.inc" - DEPENDS cxx-generate-packed-data - ) + COMMAND ${CMAKE_COMMAND} + ARGS -E env PATH="${OS_PATH_VARIABLE}" -- cxx-generate-packed-data + ">t/generated-code2/test-full-cxx-output.inc" + DEPENDS cxx-generate-packed-data +) GENERATE_TEST_SOURCES(${TEST_DIR}/test-optimized.proto t/test-optimized.pb-c.c t/test-optimized.pb-c.h) ADD_EXECUTABLE(test-generated-code2 ${TEST_DIR}/generated-code2/test-generated-code2.c t/generated-code2/test-full-cxx-output.inc t/test-full.pb-c.h t/test-full.pb-c.c t/test-optimized.pb-c.h t/test-optimized.pb-c.c) TARGET_LINK_LIBRARIES(test-generated-code2 protobuf-c) - - GENERATE_TEST_SOURCES(${TEST_DIR}/issue220/issue220.proto t/issue220/issue220.pb-c.c t/issue220/issue220.pb-c.h) ADD_EXECUTABLE(test-issue220 ${TEST_DIR}/issue220/issue220.c t/issue220/issue220.pb-c.c t/issue220/issue220.pb-c.h) TARGET_LINK_LIBRARIES(test-issue220 protobuf-c) @@ -181,26 +257,51 @@ ENDIF() ENDIF() -INSTALL(TARGETS protoc-gen-c RUNTIME DESTINATION bin) +list(APPEND PROTOBUF_C_TARGETS "protoc-gen-c") ENDIF() # BUILD_PROTOC -INSTALL(TARGETS protobuf-c LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS ${PROTOBUF_C_TARGETS} + EXPORT protobuf-c-targets + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin +) + INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h ${MAIN_DIR}/protobuf-c/protobuf-c.proto DESTINATION include/protobuf-c) INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include) -INSTALL(FILES ${CMAKE_BINARY_DIR}/protobuf-c.pdb DESTINATION lib OPTIONAL) - -IF(CMAKE_HOST_UNIX) -INSTALL(CODE "EXECUTE_PROCESS (COMMAND ln -sf protoc-gen-c protoc-c WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)") -ENDIF() +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c.pdb DESTINATION lib OPTIONAL) -INCLUDE(GNUInstallDirs) SET(prefix ${CMAKE_INSTALL_PREFIX}) SET(exec_prefix \${prefix}) SET(bindir \${exec_prefix}/${CMAKE_INSTALL_BINDIR}) SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) CONFIGURE_FILE(${MAIN_DIR}/protobuf-c/libprotobuf-c.pc.in libprotobuf-c.pc @ONLY) -INSTALL(FILES ${CMAKE_BINARY_DIR}/libprotobuf-c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libprotobuf-c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +install(EXPORT protobuf-c-targets + NAMESPACE protobuf-c:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/protobuf-c +) + +include(CMakePackageConfigHelpers) +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/protobuf-c-config.cmake" + INSTALL_DESTINATION "lib/cmake/protobuf-c" +) + +write_basic_package_version_file(protobuf-c-config-version.cmake + VERSION ${PACKAGE_VERSION} + COMPATIBILITY SameMajorVersion +) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/protobuf-c +) + +export(EXPORT protobuf-c-targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/protobuf-c-targets.cmake" +) IF(BUILD_TESTS) INCLUDE(Dart) @@ -212,7 +313,18 @@ ADD_TEST(test-issue220 test-issue220) ADD_TEST(test-issue251 test-issue251) ADD_TEST(test-version test-version) -ENDIF() +if(WIN32) + set_tests_properties( + test-generated-code + test-generated-code2 + test-generated-code3 + test-issue220 + test-issue251 + test-version + PROPERTIES ENVIRONMENT "PATH=${WINDOWS_PATH_VARIABLE}\\;$<TARGET_FILE_DIR:protoc-gen-c>" ) +endif(WIN32) + +ENDIF() INCLUDE(CPack) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/config.h.in new/protobuf-c-1.5.0/config.h.in --- old/protobuf-c-1.4.1/config.h.in 2022-07-11 03:35:24.000000000 +0200 +++ new/protobuf-c-1.5.0/config.h.in 2023-11-26 00:21:32.000000000 +0100 @@ -3,8 +3,8 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD -/* define if the compiler supports basic C++11 syntax */ -#undef HAVE_CXX11 +/* define if the compiler supports basic C++17 syntax */ +#undef HAVE_CXX17 /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -19,9 +19,6 @@ /* Define to 1 if you have the <minix/config.h> header file. */ #undef HAVE_MINIX_CONFIG_H -/* Support proto3 syntax */ -#undef HAVE_PROTO3 - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/configure.ac new/protobuf-c-1.5.0/configure.ac --- old/protobuf-c-1.4.1/configure.ac 2022-07-11 03:33:59.000000000 +0200 +++ new/protobuf-c-1.5.0/configure.ac 2023-11-26 00:21:25.000000000 +0100 @@ -1,7 +1,7 @@ -AC_PREREQ(2.63) +AC_PREREQ([2.63]) AC_INIT([protobuf-c], - [1.4.1], + [1.5.0], [https://github.com/protobuf-c/protobuf-c/issues], [protobuf-c], [https://github.com/protobuf-c/protobuf-c]) @@ -11,7 +11,7 @@ AC_CONFIG_SRCDIR([protobuf-c/protobuf-c.c]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules subdir-objects]) -AC_PROG_CC_STDC +AC_PROG_CC AC_PROG_CXX AC_PROG_LN_S AC_PROG_MKDIR_P @@ -38,10 +38,6 @@ -Wstrict-prototypes \ -Wtype-limits \ " -#AX_CHECK_COMPILE_FLAG(["-Wc90-c99-compat"], -# [my_CFLAGS="$my_CFLAGS -Wc90-c99-compat"]) -AX_CHECK_COMPILE_FLAG(["-Wc99-c11-compat"], - [my_CFLAGS="$my_CFLAGS -Wc99-c11-compat"]) AX_CHECK_COMPILE_FLAG(["-Werror=incompatible-pointer-types"], [my_CFLAGS="$my_CFLAGS -Werror=incompatible-pointer-types"]) AX_CHECK_COMPILE_FLAG(["-Werror=int-conversion"], @@ -69,19 +65,12 @@ fi fi -proto3_supported="no" - AC_ARG_ENABLE([protoc], AS_HELP_STRING([--disable-protoc], [Disable building protoc_c (also disables tests)])) if test "x$enable_protoc" != "xno"; then AC_LANG_PUSH([C++]) - - AX_CXX_COMPILE_STDCXX(11, noext, mandatory) - - PKG_CHECK_MODULES([protobuf], [protobuf >= 3.0.0], - [proto3_supported=yes], - [PKG_CHECK_MODULES([protobuf], [protobuf >= 2.6.0])] - ) + AX_CXX_COMPILE_STDCXX(17, noext, mandatory) + PKG_CHECK_MODULES([protobuf], [protobuf >= 3.0.0]) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$save_CPPFLAGS $protobuf_CFLAGS" @@ -104,11 +93,8 @@ fi AM_CONDITIONAL([BUILD_COMPILER], [test "x$enable_protoc" != "xno"]) -AM_CONDITIONAL([BUILD_PROTO3], [test "x$proto3_supported" != "xno"]) AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" != "xno"]) -AM_COND_IF([BUILD_PROTO3], [AC_DEFINE([HAVE_PROTO3], [1], [Support proto3 syntax])]) - gl_LD_VERSION_SCRIPT gl_VALGRIND_TESTS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protobuf-c/protobuf-c.c new/protobuf-c-1.5.0/protobuf-c/protobuf-c.c --- old/protobuf-c-1.4.1/protobuf-c/protobuf-c.c 2022-07-11 03:33:59.000000000 +0200 +++ new/protobuf-c-1.5.0/protobuf-c/protobuf-c.c 2023-11-26 00:21:25.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors. + * Copyright (c) 2008-2023, Dave Benson and the protobuf-c authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1888,7 +1888,6 @@ for (i = 0; i < count; i++) { unsigned len = boolean_pack(((protobuf_c_boolean *) array)[i], scratch); buffer->append(buffer, len, scratch); - rv += len; } return count; default: @@ -1923,6 +1922,7 @@ buffer->append(buffer, rv, scratch); tmp = pack_buffer_packed_payload(field, count, array, buffer); assert(tmp == payload_len); + (void)tmp; return rv + payload_len; } else { size_t siz; @@ -2556,7 +2556,7 @@ if (maybe_clear && *pstr != NULL) { const char *def = scanned_member->field->default_value; - if (*pstr != NULL && *pstr != def) + if (*pstr != def) do_free(allocator, *pstr); } *pstr = do_alloc(allocator, len - pref_len + 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protobuf-c/protobuf-c.h new/protobuf-c-1.5.0/protobuf-c/protobuf-c.h --- old/protobuf-c-1.4.1/protobuf-c/protobuf-c.h 2022-07-11 03:33:59.000000000 +0200 +++ new/protobuf-c-1.5.0/protobuf-c/protobuf-c.h 2023-11-26 00:21:25.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors. + * Copyright (c) 2008-2023, Dave Benson and the protobuf-c authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -794,13 +794,13 @@ * The version of the protobuf-c headers, represented as a string using the same * format as protobuf_c_version(). */ -#define PROTOBUF_C_VERSION "1.4.1" +#define PROTOBUF_C_VERSION "1.5.0" /** * The version of the protobuf-c headers, represented as an integer using the * same format as protobuf_c_version_number(). */ -#define PROTOBUF_C_VERSION_NUMBER 1004001 +#define PROTOBUF_C_VERSION_NUMBER 1005000 /** * The minimum protoc-c version which works with the current version of the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_bytes_field.h new/protobuf-c-1.5.0/protoc-c/c_bytes_field.h --- old/protobuf-c-1.4.1/protoc-c/c_bytes_field.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_bytes_field.h 2023-11-26 00:21:25.000000000 +0100 @@ -87,8 +87,6 @@ private: std::map<std::string, std::string> variables_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(BytesFieldGenerator); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_enum.h new/protobuf-c-1.5.0/protoc-c/c_enum.h --- old/protobuf-c-1.4.1/protoc-c/c_enum.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_enum.h 2023-11-26 00:21:25.000000000 +0100 @@ -106,8 +106,6 @@ private: const EnumDescriptor* descriptor_; std::string dllexport_decl_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_enum_field.h new/protobuf-c-1.5.0/protoc-c/c_enum_field.h --- old/protobuf-c-1.4.1/protoc-c/c_enum_field.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_enum_field.h 2023-11-26 00:21:25.000000000 +0100 @@ -85,8 +85,6 @@ private: std::map<std::string, std::string> variables_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_extension.h new/protobuf-c-1.5.0/protoc-c/c_extension.h --- old/protobuf-c-1.4.1/protoc-c/c_extension.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_extension.h 2023-11-26 00:21:25.000000000 +0100 @@ -98,8 +98,6 @@ const FieldDescriptor* descriptor_; std::string type_traits_; std::string dllexport_decl_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_field.cc new/protobuf-c-1.5.0/protoc-c/c_field.cc --- old/protobuf-c-1.4.1/protoc-c/c_field.cc 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_field.cc 2023-11-26 00:21:25.000000000 +0100 @@ -159,6 +159,11 @@ if (oneof != NULL) variables["flags"] += " | PROTOBUF_C_FIELD_FLAG_ONEOF"; + // Eliminate codesmell "or with 0" + if (variables["flags"].find("0 | ") == 0) { + variables["flags"].erase(0, 4); + } + printer->Print("{\n"); if (descriptor_->file()->options().has_optimize_for() && descriptor_->file()->options().optimize_for() == diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_field.h new/protobuf-c-1.5.0/protoc-c/c_field.h --- old/protobuf-c-1.4.1/protoc-c/c_field.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_field.h 2023-11-26 00:21:25.000000000 +0100 @@ -103,9 +103,6 @@ const std::string &type_macro, const std::string &descriptor_addr) const; const FieldDescriptor *descriptor_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGenerator); }; // Convenience class which constructs FieldGenerators for a Descriptor. @@ -121,8 +118,6 @@ std::unique_ptr<std::unique_ptr<FieldGenerator>[]> field_generators_; static FieldGenerator* MakeGenerator(const FieldDescriptor* field); - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_file.cc new/protobuf-c-1.5.0/protoc-c/c_file.cc --- old/protobuf-c-1.4.1/protoc-c/c_file.cc 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_file.cc 2023-11-26 00:21:25.000000000 +0100 @@ -118,11 +118,13 @@ std::string filename_identifier = FilenameIdentifier(file_->name()); int min_header_version = 1000000; -#if defined(HAVE_PROTO3) +#if GOOGLE_PROTOBUF_VERSION >= 4023000 + if (FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3) { +#else if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) { +#endif min_header_version = 1003000; } -#endif // Generate top of header. printer->Print( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_file.h new/protobuf-c-1.5.0/protoc-c/c_file.h --- old/protobuf-c-1.4.1/protoc-c/c_file.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_file.h 2023-11-26 00:21:25.000000000 +0100 @@ -103,8 +103,6 @@ std::unique_ptr<std::unique_ptr<EnumGenerator>[]> enum_generators_; std::unique_ptr<std::unique_ptr<ServiceGenerator>[]> service_generators_; std::unique_ptr<std::unique_ptr<ExtensionGenerator>[]> extension_generators_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_generator.h new/protobuf-c-1.5.0/protoc-c/c_generator.h --- old/protobuf-c-1.4.1/protoc-c/c_generator.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_generator.h 2023-11-26 00:21:25.000000000 +0100 @@ -93,9 +93,6 @@ const std::string& parameter, OutputDirectory* output_directory, std::string* error) const; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CGenerator); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_helpers.cc new/protobuf-c-1.5.0/protoc-c/c_helpers.cc --- old/protobuf-c-1.4.1/protoc-c/c_helpers.cc 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_helpers.cc 2023-11-26 00:21:25.000000000 +0100 @@ -234,7 +234,7 @@ std::vector<std::string> comment_lines; SplitStringUsing (comment, "\r\n", &comment_lines); printer->Print ("/*\n"); - for (int i = 0; i < comment_lines.size(); i++) + for (size_t i = 0; i < comment_lines.size(); i++) { if (!comment_lines[i].empty()) { @@ -286,7 +286,7 @@ std::set<std::string> MakeKeywordsMap() { std::set<std::string> result; - for (int i = 0; i < GOOGLE_ARRAYSIZE(kKeywordList); i++) { + for (size_t i = 0; i < GOOGLE_ARRAYSIZE(kKeywordList); i++) { result.insert(kKeywordList[i]); } return result; @@ -526,7 +526,7 @@ if (!isprint(*src) || (last_hex_escape && isxdigit(*src))) { if (dest_len - used < 4) // need space for 4 letter escape return -1; - sprintf(dest + used, (use_hex ? "\\x%02x" : "\\%03o"), + snprintf(dest + used, dest_len - used, (use_hex ? "\\x%02x" : "\\%03o"), static_cast<uint8>(*src)); is_hex_escape = use_hex; used += 4; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_helpers.h new/protobuf-c-1.5.0/protoc-c/c_helpers.h --- old/protobuf-c-1.4.1/protoc-c/c_helpers.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_helpers.h 2023-11-26 00:21:25.000000000 +0100 @@ -70,6 +70,10 @@ #include <protobuf-c/protobuf-c.pb.h> #include <google/protobuf/io/printer.h> +#if GOOGLE_PROTOBUF_VERSION >= 4023000 +# include <google/protobuf/descriptor_legacy.h> +#endif + namespace google { namespace protobuf { namespace compiler { @@ -171,13 +175,23 @@ // Return the syntax version of the file containing the field. // This wrapper is needed to be able to compile against protobuf2. inline int FieldSyntax(const FieldDescriptor* field) { -#ifdef HAVE_PROTO3 - return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2; +#if GOOGLE_PROTOBUF_VERSION >= 4023000 + return FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3 ? 3 : 2; #else - return 2; + return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2; #endif } +// Work around changes in protobuf >= 22.x without breaking compilation against +// older protobuf versions. +#if GOOGLE_PROTOBUF_VERSION >= 4022000 +# define GOOGLE_ARRAYSIZE ABSL_ARRAYSIZE +# define GOOGLE_CHECK_EQ ABSL_CHECK_EQ +# define GOOGLE_CHECK_EQ ABSL_CHECK_EQ +# define GOOGLE_DCHECK_GE ABSL_DCHECK_GE +# define GOOGLE_LOG ABSL_LOG +#endif + } // namespace c } // namespace compiler } // namespace protobuf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_message.cc new/protobuf-c-1.5.0/protoc-c/c_message.cc --- old/protobuf-c-1.4.1/protoc-c/c_message.cc 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_message.cc 2023-11-26 00:21:25.000000000 +0100 @@ -499,7 +499,7 @@ // NOTE: not supported by protobuf vars["maybe_static"] = ""; vars["field_dv_ctype"] = "{ ... }"; - GOOGLE_LOG(DFATAL) << "Messages can't have default values!"; + GOOGLE_LOG(FATAL) << "Messages can't have default values!"; break; case FieldDescriptor::CPPTYPE_STRING: if (fd->type() == FieldDescriptor::TYPE_BYTES || opt.string_as_bytes()) @@ -521,7 +521,7 @@ break; } default: - GOOGLE_LOG(DFATAL) << "Unknown CPPTYPE"; + GOOGLE_LOG(FATAL) << "Unknown CPPTYPE"; break; } if (!already_defined) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_message.h new/protobuf-c-1.5.0/protoc-c/c_message.h --- old/protobuf-c-1.4.1/protoc-c/c_message.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_message.h 2023-11-26 00:21:25.000000000 +0100 @@ -136,8 +136,6 @@ 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); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_message_field.h new/protobuf-c-1.5.0/protoc-c/c_message_field.h --- old/protobuf-c-1.4.1/protoc-c/c_message_field.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_message_field.h 2023-11-26 00:21:25.000000000 +0100 @@ -82,10 +82,6 @@ void GenerateDescriptorInitializer(io::Printer* printer) const; std::string GetDefaultValue(void) const; void GenerateStaticInit(io::Printer* printer) const; - - private: - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_primitive_field.cc new/protobuf-c-1.5.0/protoc-c/c_primitive_field.cc --- old/protobuf-c-1.4.1/protoc-c/c_primitive_field.cc 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_primitive_field.cc 2023-11-26 00:21:25.000000000 +0100 @@ -143,7 +143,7 @@ case FieldDescriptor::CPPTYPE_BOOL: return descriptor_->default_value_bool() ? "1" : "0"; default: - GOOGLE_LOG(DFATAL) << "unexpected CPPTYPE in c_primitive_field"; + GOOGLE_LOG(FATAL) << "unexpected CPPTYPE in c_primitive_field"; return "UNEXPECTED_CPPTYPE"; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_primitive_field.h new/protobuf-c-1.5.0/protoc-c/c_primitive_field.h --- old/protobuf-c-1.4.1/protoc-c/c_primitive_field.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_primitive_field.h 2023-11-26 00:21:25.000000000 +0100 @@ -82,10 +82,6 @@ void GenerateDescriptorInitializer(io::Printer* printer) const; std::string GetDefaultValue(void) const; void GenerateStaticInit(io::Printer* printer) const; - - private: - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_service.h new/protobuf-c-1.5.0/protoc-c/c_service.h --- old/protobuf-c-1.4.1/protoc-c/c_service.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_service.h 2023-11-26 00:21:25.000000000 +0100 @@ -100,8 +100,6 @@ const ServiceDescriptor* descriptor_; std::map<std::string, std::string> vars_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); }; } // namespace c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/c_string_field.h new/protobuf-c-1.5.0/protoc-c/c_string_field.h --- old/protobuf-c-1.4.1/protoc-c/c_string_field.h 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/c_string_field.h 2023-11-26 00:21:25.000000000 +0100 @@ -87,8 +87,6 @@ private: std::map<std::string, std::string> variables_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/protoc-c/main.cc new/protobuf-c-1.5.0/protoc-c/main.cc --- old/protobuf-c-1.4.1/protoc-c/main.cc 2019-06-24 06:36:20.000000000 +0200 +++ new/protobuf-c-1.5.0/protoc-c/main.cc 2023-11-26 00:21:25.000000000 +0100 @@ -9,9 +9,9 @@ std::string invocation_name = argv[0]; std::string invocation_basename = invocation_name.substr(invocation_name.find_last_of("/") + 1); - const std::string legacy_name = "protoc-c"; + const std::string standalone_name = "protoc-c"; - if (invocation_basename == legacy_name) { + if (invocation_basename == standalone_name) { google::protobuf::compiler::CommandLineInterface cli; cli.RegisterGenerator("--c_out", &c_generator, "Generate C/H files."); cli.SetVersionInfo(PACKAGE_STRING); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/generated-code2/test-generated-code2.c new/protobuf-c-1.5.0/t/generated-code2/test-generated-code2.c --- old/protobuf-c-1.4.1/t/generated-code2/test-generated-code2.c 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/t/generated-code2/test-generated-code2.c 2023-11-26 00:21:25.000000000 +0100 @@ -5,6 +5,9 @@ #include "t/test-optimized.pb-c.h" #include "t/generated-code2/test-full-cxx-output.inc" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeclaration-after-statement" + #define TEST_ENUM_SMALL_TYPE_NAME Foo__TestEnumSmall #define TEST_ENUM_SMALL(shortname) FOO__TEST_ENUM_SMALL__##shortname #define TEST_ENUM_TYPE_NAME Foo__TestEnum @@ -2370,7 +2373,7 @@ }; #define n_tests (sizeof(tests)/sizeof(Test)) -int main () +int main(void) { unsigned i; for (i = 0; i < n_tests; i++) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/issue204/issue204.proto new/protobuf-c-1.5.0/t/issue204/issue204.proto --- old/protobuf-c-1.4.1/t/issue204/issue204.proto 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/t/issue204/issue204.proto 2023-11-26 00:21:25.000000000 +0100 @@ -1,3 +1,5 @@ +syntax = "proto2"; + import "protobuf-c/protobuf-c.proto"; option (pb_c_file).use_oneof_field_name = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/issue220/issue220.proto new/protobuf-c-1.5.0/t/issue220/issue220.proto --- old/protobuf-c-1.4.1/t/issue220/issue220.proto 2017-08-05 23:43:57.000000000 +0200 +++ new/protobuf-c-1.5.0/t/issue220/issue220.proto 2023-11-26 00:21:25.000000000 +0100 @@ -1,3 +1,5 @@ +syntax = "proto2"; + message TopLevel { oneof submessages { MessageType1 type1 = 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/issue251/issue251.proto new/protobuf-c-1.5.0/t/issue251/issue251.proto --- old/protobuf-c-1.4.1/t/issue251/issue251.proto 2017-08-05 23:43:57.000000000 +0200 +++ new/protobuf-c-1.5.0/t/issue251/issue251.proto 2023-11-26 00:21:25.000000000 +0100 @@ -1,3 +1,5 @@ +syntax = "proto2"; + message two_oneofs { oneof first_oneof { bool a = 10; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/test-full.proto new/protobuf-c-1.5.0/t/test-full.proto --- old/protobuf-c-1.4.1/t/test-full.proto 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/t/test-full.proto 2023-11-26 00:21:25.000000000 +0100 @@ -1,3 +1,5 @@ +syntax = "proto2"; + package foo; import "protobuf-c/protobuf-c.proto"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/test-optimized.proto new/protobuf-c-1.5.0/t/test-optimized.proto --- old/protobuf-c-1.4.1/t/test-optimized.proto 2017-08-05 22:47:18.000000000 +0200 +++ new/protobuf-c-1.5.0/t/test-optimized.proto 2023-11-26 00:21:25.000000000 +0100 @@ -1,3 +1,5 @@ +syntax = "proto2"; + package foo; option optimize_for = CODE_SIZE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/test.proto new/protobuf-c-1.5.0/t/test.proto --- old/protobuf-c-1.4.1/t/test.proto 2021-05-19 03:51:00.000000000 +0200 +++ new/protobuf-c-1.5.0/t/test.proto 2023-11-26 00:21:25.000000000 +0100 @@ -1,3 +1,5 @@ +syntax = "proto2"; + package foo; import "protobuf-c/protobuf-c.proto"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/protobuf-c-1.4.1/t/version/version.c new/protobuf-c-1.5.0/t/version/version.c --- old/protobuf-c-1.4.1/t/version/version.c 2019-06-24 06:36:20.000000000 +0200 +++ new/protobuf-c-1.5.0/t/version/version.c 2023-11-26 00:21:25.000000000 +0100 @@ -35,7 +35,7 @@ #include "protobuf-c.h" int -main(int argc, char **argv) +main(void) { printf("PACKAGE_VERSION = %s\n", PACKAGE_VERSION);
