updated protobuf to 3.18.1

This commit is contained in:
Sven Czarnian
2021-10-10 20:51:05 +02:00
parent ea460b1aaf
commit 7d69203486
69 changed files with 6374 additions and 3669 deletions

View File

@@ -52,6 +52,35 @@
// GCC, and MSVC. Function-like macros are usable without an #ifdef guard.
// Syntax macros (for example, attributes) are always defined, although
// they may be empty.
//
// Some definitions rely on the NDEBUG macro and/or (in MSVC) _DEBUG:
// - https://en.cppreference.com/w/c/error/assert
// - https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros#microsoft-specific-predefined-macros
//
// References for predefined macros:
// - Standard: https://en.cppreference.com/w/cpp/preprocessor/replace
// - Clang: https://clang.llvm.org/docs/LanguageExtensions.html
// (see also GCC predefined macros)
// - GCC: https://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html
// - MSVC: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
// - Interactive (Clang/GCC only): https://www.compiler-explorer.com/z/hc6jKd3sj
//
// References for attributes (and extension attributes):
// - Standard: https://en.cppreference.com/w/cpp/language/attributes
// - Clang: https://clang.llvm.org/docs/AttributeReference.html
// - GCC: https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
// (see Clang attribute docs as well)
//
// References for standard C++ language conformance (and minimum versions):
// - Clang: https://clang.llvm.org/cxx_status.html
// - GCC: https://gcc.gnu.org/projects/cxx-status.html
// - MSVC: https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance
//
// Historical release notes (which can help to determine minimum versions):
// - Clang: https://releases.llvm.org/
// - GCC: https://gcc.gnu.org/releases.html
// - MSVC: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-history
// https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes-history
// Portable fallbacks for C++20 feature test macros:
// https://en.cppreference.com/w/cpp/feature_test
@@ -99,6 +128,23 @@
# define PROTOBUF_GNUC_MIN(x, y) 0
#endif
// Portable check for MSVC minimum version:
// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
#if defined(_MSC_VER)
#define PROTOBUF_MSC_VER_MIN(x) (_MSC_VER >= x)
#else
#define PROTOBUF_MSC_VER_MIN(x) 0
#endif
// Portable check for minimum C++ language version:
// https://en.cppreference.com/w/cpp/preprocessor/replace
// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
#if !defined(_MSVC_LANG)
#define PROTOBUF_CPLUSPLUS_MIN(x) (__cplusplus >= x)
#else
#define PROTOBUF_CPLUSPLUS_MIN(x) (_MSVC_LANG >= x)
#endif
// Future versions of protobuf will include breaking changes to some APIs.
// This macro can be set to enable these API changes ahead of time, so that
// user code can be updated before upgrading versions of protobuf.
@@ -107,17 +153,17 @@
#ifdef PROTOBUF_VERSION
#error PROTOBUF_VERSION was previously defined
#endif
#define PROTOBUF_VERSION 3017003
#define PROTOBUF_VERSION 3018001
#ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
#error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined
#endif
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3017000
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3018000
#ifdef PROTOBUF_MIN_PROTOC_VERSION
#error PROTOBUF_MIN_PROTOC_VERSION was previously defined
#endif
#define PROTOBUF_MIN_PROTOC_VERSION 3017000
#define PROTOBUF_MIN_PROTOC_VERSION 3018000
#ifdef PROTOBUF_VERSION_SUFFIX
#error PROTOBUF_VERSION_SUFFIX was previously defined
@@ -184,8 +230,9 @@
#error PROTOBUF_TAILCALL was previously defined
#endif
#if __has_cpp_attribute(clang::musttail) && \
!defined(_ARCH_PPC) && !defined(__wasm__)
!defined(__arm__) && !defined(_ARCH_PPC) && !defined(__wasm__)
# ifndef PROTO2_OPENSOURCE
// Compilation fails on ARM32: b/195943306
// Compilation fails on powerpc64le: b/187985113
# endif
#define PROTOBUF_MUSTTAIL [[clang::musttail]]
@@ -304,7 +351,7 @@
// The minimum library version which works with the current version of the
// headers.
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3017000
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3018000
#ifdef PROTOBUF_RTTI
#error PROTOBUF_RTTI was previously defined
@@ -397,8 +444,8 @@
#error PROTOBUF_PREDICT_(TRUE|FALSE) was previously defined
#endif
#if PROTOBUF_GNUC_MIN(3, 0)
# define PROTOBUF_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
# define PROTOBUF_PREDICT_FALSE(x) (__builtin_expect((x), 0))
# define PROTOBUF_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
# define PROTOBUF_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
#else
# define PROTOBUF_PREDICT_TRUE(x) (x)
# define PROTOBUF_PREDICT_FALSE(x) (x)
@@ -409,10 +456,6 @@
#endif
# define PROTOBUF_MUST_USE_RESULT
#ifdef PROTOBUF_MUST_USE_EXTRACT_RESULT
#error PROTOBUF_MUST_USE_EXTRACT_RESULT was previously defined
#endif
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
#error PROTOBUF_FORCE_COPY_IN_RELEASE was previously defined
#endif
@@ -421,10 +464,16 @@
#error PROTOBUF_FORCE_COPY_IN_SWAP was previously defined
#endif
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
#error PROTOBUF_FORCE_COPY_IN_MOVE was previously defined
#endif
#ifdef PROTOBUF_FALLTHROUGH_INTENDED
#error PROTOBUF_FALLTHROUGH_INTENDED was previously defined
#endif
#if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
#if __has_cpp_attribute(fallthrough)
#define PROTOBUF_FALLTHROUGH_INTENDED [[fallthrough]]
#elif __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
#define PROTOBUF_FALLTHROUGH_INTENDED [[clang::fallthrough]]
#elif PROTOBUF_GNUC_MIN(7, 0)
#define PROTOBUF_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
@@ -559,10 +608,15 @@
#ifdef PROTOBUF_ATTRIBUTE_WEAK
#error PROTOBUF_ATTRIBUTE_WEAK was previously defined
#endif
#if __has_attribute(weak) && !defined(__MINGW32__)
#if __has_attribute(weak) && \
!defined(__APPLE__) && \
(!defined(_WIN32) || __clang_major__ < 9) && \
!defined(__MINGW32__)
#define PROTOBUF_ATTRIBUTE_WEAK __attribute__((weak))
#define PROTOBUF_HAVE_ATTRIBUTE_WEAK 1
#else
#define PROTOBUF_ATTRIBUTE_WEAK
#define PROTOBUF_HAVE_ATTRIBUTE_WEAK 0
#endif
// Macros to detect sanitizers.
@@ -590,11 +644,42 @@
# define PROTOBUF_TSAN __SANITIZE_THREAD__
#endif
// Tail call table-driven parsing can be enabled by defining
// PROTOBUF_EXPERIMENTAL_USE_TAIL_CALL_TABLE_PARSER at compilation time. Note
// that this macro is for small-scale testing only, and is not supported.
#ifdef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED
#error PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED was previously declared
#endif
#if defined(PROTOBUF_EXPERIMENTAL_USE_TAIL_CALL_TABLE_PARSER)
#define PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED 1
// Selectively use static member functions instead of templates:
#ifndef PROTOBUF_TC_STATIC_PARSE_SINGULAR1
# define PROTOBUF_TC_STATIC_PARSE_SINGULAR1 1
#endif
#ifndef PROTOBUF_TC_STATIC_PARSE_SINGULAR2
# define PROTOBUF_TC_STATIC_PARSE_SINGULAR2 0
#endif
#ifndef PROTOBUF_TC_STATIC_PARSE_REPEATED1
# define PROTOBUF_TC_STATIC_PARSE_REPEATED1 0
#endif
#ifndef PROTOBUF_TC_STATIC_PARSE_REPEATED2
# define PROTOBUF_TC_STATIC_PARSE_REPEATED2 0
#endif
#endif
#define PROTOBUF_TC_PARAM_DECL \
::google::protobuf::MessageLite *msg, const char *ptr, \
::google::protobuf::internal::ParseContext *ctx, \
const ::google::protobuf::internal::TailCallParseTableBase *table, \
uint64_t hasbits, ::google::protobuf::internal::TcFieldData data
#ifdef PROTOBUF_UNUSED
#error PROTOBUF_UNUSED was previously defined
#endif
#if __has_cpp_attribute(unused) || \
(PROTOBUF_GNUC_MIN(3, 0) && !defined(__clang__))
#if __has_cpp_attribute(maybe_unused) || \
(PROTOBUF_MSC_VER_MIN(1911) && PROTOBUF_CPLUSPLUS_MIN(201703L))
#define PROTOBUF_UNUSED [[maybe_unused]]
#elif __has_attribute(unused) || PROTOBUF_GNUC_MIN(3, 0)
#define PROTOBUF_UNUSED __attribute__((__unused__))
#else
#define PROTOBUF_UNUSED
@@ -706,4 +791,3 @@
# undef __has_builtin
# undef PROTOBUF_has_builtin_DEFINED_
#endif
#undef PROTOBUF_GNUC_MIN