Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/google/protobuf/port_def.inc is written in an unsupported language. File is not indexed.

0001 // -*- c++ -*-
0002 // Protocol Buffers - Google's data interchange format
0003 // Copyright 2008 Google Inc.  All rights reserved.
0004 //
0005 // Use of this source code is governed by a BSD-style
0006 // license that can be found in the LICENSE file or at
0007 // https://developers.google.com/open-source/licenses/bsd
0008 
0009 // This file defines common macros that are used in protobuf.
0010 //
0011 // To hide these definitions from the outside world (and to prevent collisions
0012 // if more than one version of protobuf is #included in the same project) you
0013 // must follow this pattern when #including port_def.inc in a header file:
0014 //
0015 // #include "other_header.h"
0016 // #include "message.h"
0017 // // etc.
0018 //
0019 // #include "port_def.inc"  // MUST be last header included
0020 //
0021 // // Definitions for this header.
0022 //
0023 // #include "port_undef.inc"
0024 //
0025 // This is a textual header with no include guard, because we want to
0026 // detect/prohibit anytime it is #included twice without a corresponding
0027 // #undef.
0028 
0029 #ifdef PROTOBUF_PORT_
0030 #error "port_def.inc included multiple times"
0031 #endif
0032 #define PROTOBUF_PORT_
0033 #include "absl/base/attributes.h"
0034 #include "absl/base/config.h"
0035 #include "absl/base/macros.h"
0036 
0037 // The definitions in this file are intended to be portable across Clang,
0038 // GCC, and MSVC. Function-like macros are usable without an #ifdef guard.
0039 // Syntax macros (for example, attributes) are always defined, although
0040 // they may be empty.
0041 //
0042 // Some definitions rely on the NDEBUG macro and/or (in MSVC) _DEBUG:
0043 // - https://en.cppreference.com/w/c/error/assert
0044 // - https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros#microsoft-specific-predefined-macros
0045 //
0046 // References for predefined macros:
0047 // - Standard: https://en.cppreference.com/w/cpp/preprocessor/replace
0048 // - Clang: https://clang.llvm.org/docs/LanguageExtensions.html
0049 //          (see also GCC predefined macros)
0050 // - GCC: https://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html
0051 // - MSVC: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
0052 // - Interactive (Clang/GCC only): https://www.compiler-explorer.com/z/hc6jKd3sj
0053 //
0054 // References for attributes (and extension attributes):
0055 // - Standard: https://en.cppreference.com/w/cpp/language/attributes
0056 // - Clang: https://clang.llvm.org/docs/AttributeReference.html
0057 // - GCC: https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
0058 //        (see Clang attribute docs as well)
0059 //
0060 // References for standard C++ language conformance (and minimum versions):
0061 // - Clang: https://clang.llvm.org/cxx_status.html
0062 // - GCC: https://gcc.gnu.org/projects/cxx-status.html
0063 // - MSVC: https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance
0064 //
0065 // Historical release notes (which can help to determine minimum versions):
0066 // - Clang: https://releases.llvm.org/
0067 // - GCC: https://gcc.gnu.org/releases.html
0068 // - MSVC: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-history
0069 //         https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes-history
0070 
0071 // Portable check for gcc-style atomic built-ins
0072 #if ABSL_HAVE_BUILTIN(__atomic_load_n)
0073 #define PROTOBUF_BUILTIN_ATOMIC 1
0074 #endif
0075 
0076 // Portable check for GCC minimum version:
0077 // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
0078 #if defined(__GNUC__) && defined(__GNUC_MINOR__) \
0079     && defined(__GNUC_PATCHLEVEL__)
0080 #  define PROTOBUF_GNUC_MIN(x, y) \
0081   (__GNUC__ > (x) || (__GNUC__ == (x) && __GNUC_MINOR__ >= (y)))
0082 #else
0083 #  define PROTOBUF_GNUC_MIN(x, y) 0
0084 #endif
0085 
0086 #if defined(__clang__) && defined(__clang_major__) && defined(__clang_minor__)
0087 #define PROTOBUF_CLANG_MIN(x, y) \
0088   (__clang_major__ > (x) || (__clang_major__ == (x) && __clang_minor__ >= (y)))
0089 #else
0090 #define PROTOBUF_CLANG_MIN(x, y) 0
0091 #endif
0092 
0093 // Portable check for MSVC minimum version:
0094 // https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
0095 #if defined(_MSC_VER)
0096 #define PROTOBUF_MSC_VER_MIN(x) (_MSC_VER >= x)
0097 #else
0098 #define PROTOBUF_MSC_VER_MIN(x) 0
0099 #endif
0100 
0101 // Portable check for minimum C++ language version:
0102 // https://en.cppreference.com/w/cpp/preprocessor/replace
0103 // https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
0104 #if !defined(_MSVC_LANG)
0105 #define PROTOBUF_CPLUSPLUS_MIN(x) (__cplusplus >= x)
0106 #else
0107 #define PROTOBUF_CPLUSPLUS_MIN(x) (_MSVC_LANG >= x)
0108 #endif
0109 
0110 // Check minimum Protobuf support defined at:
0111 // https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md
0112 #ifdef __clang__
0113 static_assert(PROTOBUF_CLANG_MIN(6, 0), "Protobuf only supports Clang 6.0 and newer.");
0114 #elif defined(__GNUC__)
0115 static_assert(PROTOBUF_GNUC_MIN(7, 3), "Protobuf only supports GCC 7.3 and newer.");
0116 #elif defined(_MSVC_LANG)
0117 static_assert(PROTOBUF_MSC_VER_MIN(1910), "Protobuf only supports MSVC 2017 and newer.");
0118 #endif
0119 static_assert(PROTOBUF_CPLUSPLUS_MIN(201703L),
0120               "Protobuf only supports C++17 and newer.");
0121 
0122 // Check minimum Abseil version.
0123 #if defined(ABSL_LTS_RELEASE_VERSION) && defined(ABSL_LTS_RELEASE_PATCH_LEVEL)
0124 #define PROTOBUF_ABSL_MIN(x, y)      \
0125   (ABSL_LTS_RELEASE_VERSION > (x) || \
0126    (ABSL_LTS_RELEASE_VERSION == (x) && ABSL_LTS_RELEASE_PATCH_LEVEL >= (y)))
0127 #else
0128 // If we can't find an Abseil version, it's either not installed at all (which
0129 // should trigger cmake errors), using a non-LTS release, or just isn't used in
0130 // this file.
0131 #define PROTOBUF_ABSL_MIN(x, y) 1
0132 #endif
0133 
0134 static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
0135               "Protobuf only supports Abseil version 20230125.3 and newer.");
0136 
0137 // Future versions of protobuf will include breaking changes to some APIs.
0138 // This macro can be set to enable these API changes ahead of time, so that
0139 // user code can be updated before upgrading versions of protobuf.
0140 
0141 #ifdef PROTOBUF_FUTURE_BREAKING_CHANGES
0142 
0143 // Used for descriptor proto extension declarations.
0144 // Owner: shaod@, gberg@
0145 #define PROTOBUF_FUTURE_DESCRIPTOR_EXTENSION_DECL 1
0146 
0147 // Renames DescriptorPool::AddUnusedImportTrackFile
0148 // Owner: mkruskal@
0149 #define PROTOBUF_FUTURE_RENAME_ADD_UNUSED_IMPORT 1
0150 
0151 // Removes google::protobuf::util::MessageDifferencer::AddIgnoreCriteria that takes a
0152 // raw pointer as an argument in favor of the overload that takes a unique_ptr.
0153 // Owner: mkruskal@, natebrennan@
0154 #define PROTOBUF_FUTURE_REMOVE_ADD_IGNORE_CRITERIA 1
0155 
0156 // Marks several logically constant operations on Repeated*Field as nodiscard.
0157 // Owner: ckennelly@, mkruskal@
0158 #define PROTOBUF_FUTURE_ADD_NODISCARD [[nodiscard]]
0159 
0160 #else
0161 
0162 #define PROTOBUF_FUTURE_ADD_NODISCARD
0163 
0164 #endif
0165 
0166 // Introducing a future-breaking change guard for descriptor database migration.
0167 // This allows google3 to transition to absl::string_view while keeping OSS
0168 // on std::string until the migration is fully completed.
0169 // The temporary macro enables incremental migration before permanently flipping
0170 // the switch.
0171 #ifdef PROTOBUF_FUTURE_STRING_VIEW_DESCRIPTOR_DATABASE
0172 #error PROTOBUF_FUTURE_STRING_VIEW_DESCRIPTOR_DATABASE was previously defined
0173 #endif
0174 
0175 #if defined(PROTOBUF_TEMPORARY_ENABLE_STRING_VIEW_DESCRIPTOR_DATABASE)
0176 #define PROTOBUF_FUTURE_STRING_VIEW_DESCRIPTOR_DATABASE 1
0177 #endif
0178 
0179 #ifdef PROTOBUF_ALWAYS_INLINE
0180 #error PROTOBUF_ALWAYS_INLINE was previously defined
0181 #endif
0182 // For functions we want to force inline.
0183 #if defined(PROTOBUF_NO_INLINE)
0184 #define PROTOBUF_ALWAYS_INLINE inline
0185 #elif defined(__GNUC__)
0186 #define PROTOBUF_ALWAYS_INLINE inline __attribute__((always_inline))
0187 #elif defined(_MSC_VER)
0188 #define PROTOBUF_ALWAYS_INLINE __forceinline
0189 #else
0190 #define PROTOBUF_ALWAYS_INLINE inline
0191 #endif
0192 
0193 #ifdef PROTOBUF_ALWAYS_INLINE_CALL
0194 #error PROTOBUF_ALWAYS_INLINE_CALL was previously defined
0195 #endif
0196 // For functions we want to force inline from the caller, instead of in the
0197 // declaration of the callee.
0198 // This is useful for lambdas where it is not easy to specify ALWAYS_INLINE.
0199 // Use like:
0200 //   PROTOBUF_ALWAYS_INLINE_CALL res = SomeFunc(args...);
0201 #if defined(__clang__) && !defined(PROTOBUF_NO_INLINE_CALL) && \
0202     ABSL_HAVE_CPP_ATTRIBUTE(clang::always_inline)
0203 #define PROTOBUF_ALWAYS_INLINE_CALL [[clang::always_inline]]
0204 #else
0205 #define PROTOBUF_ALWAYS_INLINE_CALL
0206 #endif
0207 
0208 #ifdef PROTOBUF_NDEBUG_INLINE
0209 #error PROTOBUF_NDEBUG_INLINE was previously defined
0210 #endif
0211 // Avoid excessive inlining in non-optimized builds. Without other optimizations
0212 // the inlining is not going to provide benefits anyway and the huge resulting
0213 // functions, especially in the proto-generated serialization functions, produce
0214 // stack frames so large that many tests run into stack overflows (b/32192897).
0215 #if defined(NDEBUG) || (defined(_MSC_VER) && !defined(_DEBUG))
0216 # define PROTOBUF_NDEBUG_INLINE PROTOBUF_ALWAYS_INLINE
0217 #else
0218 #define PROTOBUF_NDEBUG_INLINE inline
0219 #endif
0220 
0221 // Note that PROTOBUF_NOINLINE is an attribute applied to functions, to prevent
0222 // them from being inlined by the compiler. This is different from
0223 // PROTOBUF_NO_INLINE, which is a user-supplied macro that disables forced
0224 // inlining by PROTOBUF_(ALWAYS|NDEBUG)_INLINE.
0225 //
0226 // For forward-declared functions, make sure to apply PROTOBUF_NOINLINE to all
0227 // the declarations, not just the definition, or else whole-program optimization
0228 // may not honor the attribute.
0229 #ifdef PROTOBUF_NOINLINE
0230 #error PROTOBUF_NOINLINE was previously defined
0231 #endif
0232 #if defined(__GNUC__)
0233 # define PROTOBUF_NOINLINE __attribute__((noinline))
0234 #elif defined(_MSC_VER)
0235 // Seems to have been around since at least Visual Studio 2005
0236 # define PROTOBUF_NOINLINE __declspec(noinline)
0237 #endif
0238 
0239 #ifdef PROTOBUF_MUSTTAIL
0240 #error PROTOBUF_MUSTTAIL was previously defined
0241 #endif
0242 #ifdef PROTOBUF_TAILCALL
0243 #error PROTOBUF_TAILCALL was previously defined
0244 #endif
0245 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::musttail) && (defined(__aarch64__) || \
0246     defined(__x86_64__) || defined(_M_X64))
0247 // Compilation fails on ARM32: b/195943306
0248 // Compilation fails on powerpc64le: b/187985113
0249 // Compilation fails on X86 Windows:
0250 // https://github.com/llvm/llvm-project/issues/53271
0251 #define PROTOBUF_MUSTTAIL [[clang::musttail]]
0252 #define PROTOBUF_TAILCALL true
0253 #else
0254 #define PROTOBUF_MUSTTAIL
0255 #define PROTOBUF_TAILCALL false
0256 #endif
0257 
0258 #ifdef PROTOBUF_CC
0259 #error PROTOBUF_CC was previously defined
0260 #endif
0261 #define PROTOBUF_CC
0262 
0263 #if defined(__clang__)
0264 #define PROTOBUF_IGNORE_DEPRECATION_START                     \
0265   _Pragma("clang diagnostic push")                                  \
0266   _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
0267 #define PROTOBUF_IGNORE_DEPRECATION_STOP                     \
0268   _Pragma("clang diagnostic pop")
0269 #elif defined(__GNUC__)
0270 #define PROTOBUF_IGNORE_DEPRECATION_START                     \
0271   _Pragma("GCC diagnostic push")                                  \
0272   _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
0273 #define PROTOBUF_IGNORE_DEPRECATION_STOP                     \
0274   _Pragma("GCC diagnostic pop")
0275 #else
0276 #define PROTOBUF_IGNORE_DEPRECATION_START
0277 #define PROTOBUF_IGNORE_DEPRECATION_STOP
0278 #endif
0279 
0280 #ifdef PROTOBUF_RTTI
0281 #error PROTOBUF_RTTI was previously defined
0282 #endif
0283 #if defined(GOOGLE_PROTOBUF_NO_RTTI) && GOOGLE_PROTOBUF_NO_RTTI
0284 // A user-provided definition GOOGLE_PROTOBUF_NO_RTTI=1 disables RTTI.
0285 #define PROTOBUF_RTTI 0
0286 #elif defined(__cpp_rtti)
0287 // https://en.cppreference.com/w/cpp/feature_test
0288 #define PROTOBUF_RTTI 1
0289 #elif ABSL_HAVE_FEATURE(cxx_rtti)
0290 // https://clang.llvm.org/docs/LanguageExtensions.html#c-rtti
0291 #define PROTOBUF_RTTI 1
0292 #elif defined(__GXX_RTTI)
0293 // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
0294 #define PROTOBUF_RTTI 1
0295 #elif defined(_CPPRTTI)
0296 // https://docs.microsoft.com/en-us/cpp/build/reference/gr-enable-run-time-type-information
0297 #define PROTOBUF_RTTI 1
0298 #else
0299 #define PROTOBUF_RTTI 0
0300 #endif
0301 
0302 // Returns the offset of the given field within the given aggregate type.
0303 // This is equivalent to the ANSI C offsetof() macro.  However, according
0304 // to the C++ standard, offsetof() only works on POD types, and GCC
0305 // enforces this requirement with a warning.  In practice, this rule is
0306 // unnecessarily strict; there is probably no compiler or platform on
0307 // which the offsets of the direct fields of a class are non-constant.
0308 // Fields inherited from superclasses *can* have non-constant offsets,
0309 // but that's not what this macro will be used for.
0310 #ifdef PROTOBUF_FIELD_OFFSET
0311 #error PROTOBUF_FIELD_OFFSET was previously defined
0312 #endif
0313 #if defined(__clang__)
0314 // For Clang we use __builtin_offsetof() and suppress the warning,
0315 // to avoid Control Flow Integrity and UBSan vptr sanitizers from
0316 // crashing while trying to validate the invalid reinterpret_casts.
0317 #define PROTOBUF_FIELD_OFFSET(TYPE, FIELD)                   \
0318   _Pragma("clang diagnostic push")                           \
0319   _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
0320   __builtin_offsetof(TYPE, FIELD)                            \
0321   _Pragma("clang diagnostic pop")
0322 #elif defined(__GNUC__) || defined(_MSC_VER)
0323 #define PROTOBUF_FIELD_OFFSET(TYPE, FIELD) __builtin_offsetof(TYPE, FIELD)
0324 #else
0325 // Note that we calculate relative to the pointer value 16 here since if we
0326 // just use zero, GCC complains about dereferencing a NULL pointer.  We
0327 // choose 16 rather than some other number just in case the compiler would
0328 // be confused by an unaligned pointer.
0329 #define PROTOBUF_FIELD_OFFSET(TYPE, FIELD)                                \
0330   static_cast< ::uint32_t>(reinterpret_cast<const char*>(                   \
0331                              &reinterpret_cast<const TYPE*>(16)->FIELD) - \
0332                          reinterpret_cast<const char*>(16))
0333 #endif
0334 
0335 #ifdef PROTOBUF_EXPORT
0336 #error PROTOBUF_EXPORT was previously defined
0337 #endif
0338 
0339 #if defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
0340 # if defined(LIBPROTOBUF_EXPORTS)
0341 #  define PROTOBUF_EXPORT __declspec(dllexport)
0342 #  define PROTOBUF_EXPORT_TEMPLATE_DECLARE
0343 #  define PROTOBUF_EXPORT_TEMPLATE_DEFINE __declspec(dllexport)
0344 # else
0345 #  define PROTOBUF_EXPORT __declspec(dllimport)
0346 #  define PROTOBUF_EXPORT_TEMPLATE_DECLARE
0347 #  define PROTOBUF_EXPORT_TEMPLATE_DEFINE __declspec(dllimport)
0348 # endif  // defined(LIBPROTOBUF_EXPORTS)
0349 #elif defined(PROTOBUF_USE_DLLS) && defined(LIBPROTOBUF_EXPORTS)
0350 # define PROTOBUF_EXPORT __attribute__((visibility("default")))
0351 # define PROTOBUF_EXPORT_TEMPLATE_DECLARE __attribute__((visibility("default")))
0352 # define PROTOBUF_EXPORT_TEMPLATE_DEFINE
0353 #else
0354 # define PROTOBUF_EXPORT
0355 # define PROTOBUF_EXPORT_TEMPLATE_DECLARE
0356 # define PROTOBUF_EXPORT_TEMPLATE_DEFINE
0357 #endif
0358 
0359 #ifdef PROTOC_EXPORT
0360 #error PROTOC_EXPORT was previously defined
0361 #endif
0362 
0363 #if defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
0364 # if defined(LIBPROTOC_EXPORTS)
0365 #  define PROTOC_EXPORT __declspec(dllexport)
0366 # else
0367 #  define PROTOC_EXPORT __declspec(dllimport)
0368 # endif  // defined(LIBPROTOC_EXPORTS)
0369 #elif defined(PROTOBUF_USE_DLLS) && defined(LIBPROTOC_EXPORTS)
0370 # define PROTOC_EXPORT __attribute__((visibility("default")))
0371 #else
0372 # define PROTOC_EXPORT
0373 #endif
0374 
0375 #ifdef PROTOBUF_RESTRICT
0376 #error PROTOBUF_RESTRICT was previously defined
0377 #endif
0378 #if defined( __clang__) || defined(__GNUC__)
0379 #define PROTOBUF_RESTRICT __restrict
0380 #else
0381 #define PROTOBUF_RESTRICT
0382 #endif
0383 
0384 // Specify memory alignment for structs, classes, etc.
0385 // Use like:
0386 //   class PROTOBUF_ALIGNAS(16) MyClass { ... }
0387 //   PROTOBUF_ALIGNAS(16) int array[4];
0388 //
0389 // In most places you can use the C++11 keyword "alignas", which is preferred.
0390 //
0391 // But compilers have trouble mixing __attribute__((...)) syntax with
0392 // alignas(...) syntax.
0393 //
0394 // Doesn't work in clang or gcc:
0395 //   struct alignas(16) __attribute__((packed)) S { char c; };
0396 // Works in clang but not gcc:
0397 //   struct __attribute__((packed)) alignas(16) S2 { char c; };
0398 // Works in clang and gcc:
0399 //   struct alignas(16) S3 { char c; } __attribute__((packed));
0400 //
0401 // There are also some attributes that must be specified *before* a class
0402 // definition: visibility (used for exporting functions/classes) is one of
0403 // these attributes. This means that it is not possible to use alignas() with a
0404 // class that is marked as exported.
0405 #ifdef PROTOBUF_ALIGNAS
0406 #error PROTOBUF_ALIGNAS was previously defined
0407 #endif
0408 #if defined(_MSC_VER)
0409 #define PROTOBUF_ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
0410 #elif defined(__GNUC__)
0411 #define PROTOBUF_ALIGNAS(byte_alignment) \
0412   __attribute__((aligned(byte_alignment)))
0413 #else
0414 #define PROTOBUF_ALIGNAS(byte_alignment) alignas(byte_alignment)
0415 #endif
0416 
0417 #ifdef PROTOBUF_THREAD_LOCAL
0418 #error PROTOBUF_THREAD_LOCAL was previously defined
0419 #endif
0420 #if defined(_MSC_VER)
0421 #define PROTOBUF_THREAD_LOCAL __declspec(thread)
0422 #else
0423 #define PROTOBUF_THREAD_LOCAL __thread
0424 #endif
0425 
0426 #ifdef PROTOBUF_CONSTINIT
0427 #error PROTOBUF_CONSTINIT was previously defined
0428 #endif
0429 
0430 // Lexan sets both MSV_VER and clang, so handle it with the clang path.
0431 #if defined(_MSC_VER) && !defined(__clang__)
0432 // MSVC 17 currently seems to raise an error about constant-initialized pointers.
0433 # if PROTOBUF_MSC_VER_MIN(1930)
0434 #  define PROTOBUF_CONSTINIT
0435 #  define PROTOBUF_CONSTEXPR constexpr
0436 # endif
0437 #elif defined(__GNUC__) && !defined(__clang__)
0438 // GCC doesn't support constinit aggregate initialization of absl::Cord.
0439 # if PROTOBUF_GNUC_MIN(12, 2)
0440 #  define PROTOBUF_CONSTINIT
0441 #  define PROTOBUF_CONSTEXPR constexpr
0442 # endif
0443 #else
0444 # if defined(__cpp_constinit) && !defined(__CYGWIN__)
0445 #  define PROTOBUF_CONSTINIT constinit
0446 #  define PROTOBUF_CONSTEXPR constexpr
0447 #  define PROTOBUF_CONSTINIT_DEFAULT_INSTANCES
0448 // Some older Clang versions incorrectly raise an error about
0449 // constant-initializing weak default instance pointers. Versions 12.0 and
0450 // higher seem to work, except that XCode 12.5.1 shows the error even though it
0451 // uses Clang 12.0.5.
0452 #elif !defined(__CYGWIN__) && !defined(__MINGW32__) &&                 \
0453     ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) && \
0454     ((defined(__APPLE__) && PROTOBUF_CLANG_MIN(13, 0)) ||              \
0455      (!defined(__APPLE__) && PROTOBUF_CLANG_MIN(12, 0)))
0456 #  define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
0457 #  define PROTOBUF_CONSTEXPR constexpr
0458 #  define PROTOBUF_CONSTINIT_DEFAULT_INSTANCES
0459 # endif
0460 #endif
0461 
0462 #ifndef PROTOBUF_CONSTINIT
0463 #define PROTOBUF_CONSTINIT
0464 #define PROTOBUF_CONSTEXPR
0465 #endif
0466 
0467 // Some globals with an empty non-trivial destructor are annotated with
0468 // no_destroy for performance reasons. It reduces the cost of these globals in
0469 // non-opt mode and under sanitizers.
0470 #ifdef PROTOBUF_ATTRIBUTE_NO_DESTROY
0471 #error PROTOBUF_ATTRIBUTE_NO_DESTROY was previously defined
0472 #endif
0473 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::no_destroy)
0474 #define PROTOBUF_ATTRIBUTE_NO_DESTROY [[clang::no_destroy]]
0475 #else
0476 #define PROTOBUF_ATTRIBUTE_NO_DESTROY
0477 #endif
0478 
0479 // Protobuf extensions and reflection require registration of the protos linked
0480 // in the binary. Not until everything is registered does the runtime have a
0481 // complete view on all protos. When code is using reflection or extensions
0482 // in between registration calls this can lead to surprising behavior. By
0483 // having the registration run first we mitigate this scenario.
0484 // Highest priority is 101. We use 102 for registration, to allow code that
0485 // really wants to higher priority to still beat us. Some initialization happens
0486 // at higher priority, though, since it is needed before registration.
0487 #ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
0488 #error PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 was previously defined
0489 #endif
0490 #ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
0491 #error PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 was previously defined
0492 #endif
0493 #if defined(__GNUC__) && (!defined(__APPLE__) || defined(__clang__)) && \
0494     !((defined(sun) || defined(__sun)) &&                                     \
0495       (defined(__SVR4) || defined(__svr4__)))
0496 #define PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 __attribute__((init_priority((101))))
0497 #define PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 __attribute__((init_priority((102))))
0498 #else
0499 #define PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
0500 #define PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
0501 #endif
0502 
0503 #ifdef PROTOBUF_PRAGMA_INIT_SEG
0504 #error PROTOBUF_PRAGMA_INIT_SEG was previously defined
0505 #endif
0506 #ifdef _MSC_VER
0507 #define PROTOBUF_PRAGMA_INIT_SEG __pragma(init_seg(lib))
0508 #else
0509 #define PROTOBUF_PRAGMA_INIT_SEG
0510 #endif
0511 
0512 #ifdef PROTOBUF_ATTRIBUTE_WEAK
0513 #error PROTOBUF_ATTRIBUTE_WEAK was previously defined
0514 #endif
0515 #if ABSL_HAVE_ATTRIBUTE(weak) && !defined(__APPLE__) && \
0516     (!defined(_WIN32) || __clang_major__ < 9) && !defined(__MINGW32__)
0517 #define PROTOBUF_ATTRIBUTE_WEAK __attribute__((weak))
0518 #define PROTOBUF_HAVE_ATTRIBUTE_WEAK 1
0519 #else
0520 #define PROTOBUF_ATTRIBUTE_WEAK
0521 #define PROTOBUF_HAVE_ATTRIBUTE_WEAK 0
0522 #endif
0523 
0524 // Variable used to inject artificial language races to detect API level races.
0525 #if defined(ABSL_HAVE_THREAD_SANITIZER)
0526 #define PROTOBUF_TSAN_DECLARE_MEMBER char _tsan_detect_race = 0;
0527 #else
0528 #define PROTOBUF_TSAN_DECLARE_MEMBER
0529 #endif
0530 
0531 // Note that this is performance sensitive: changing the parameters will change
0532 // the registers used by the ABI calling convention, which subsequently affects
0533 // register selection logic inside the function.
0534 // Arguments `msg`, `ptr` and `ctx` are the 1st/2nd/3rd argument to match the
0535 // signature of ParseLoop.
0536 //
0537 // Note for x86_64: `data` must be the third or fourth argument for performance
0538 // reasons. In order to efficiently read the second byte of `data` we need it to
0539 // be passed in RDX or RCX.
0540 #define PROTOBUF_TC_PARAM_DECL                 \
0541   ::google::protobuf::MessageLite *msg, const char *ptr, \
0542       ::google::protobuf::internal::ParseContext *ctx,   \
0543       ::google::protobuf::internal::TcFieldData data,    \
0544       const ::google::protobuf::internal::TcParseTableBase *table, uint64_t hasbits
0545 // PROTOBUF_TC_PARAM_PASS passes values to match PROTOBUF_TC_PARAM_DECL.
0546 #define PROTOBUF_TC_PARAM_PASS msg, ptr, ctx, data, table, hasbits
0547 
0548 // PROTOBUF_TC_PARAM_NO_DATA_DECL and PROTOBUF_TC_PARAM_NO_DATA_PASS provide the
0549 // exact same ABI as above, except that they don't name or pass the `data`
0550 // argument. Specific functions such as `Error() and `ToTagDispatch()` don't
0551 // use the `data` argument. By not passing `data` down the call stack, we free
0552 // up the register holding that value, which may matter in highly optimized
0553 // functions such as varint parsing.
0554 #define PROTOBUF_TC_PARAM_NO_DATA_DECL                                        \
0555   ::google::protobuf::MessageLite *msg, const char *ptr,                                \
0556       ::google::protobuf::internal::ParseContext *ctx, ::google::protobuf::internal::TcFieldData, \
0557       const ::google::protobuf::internal::TcParseTableBase *table, uint64_t hasbits
0558 #define PROTOBUF_TC_PARAM_NO_DATA_PASS \
0559   msg, ptr, ctx, ::google::protobuf::internal::TcFieldData::DefaultInit(), table, hasbits
0560 
0561 // For the toolchains that support it, evaluates to `true` if the input is
0562 // determined to be a compile time constant after optimizations have happened
0563 // (like inlining and constant propagation). A `false` result means that the
0564 // compiler could not determine it is constant (it might still be but couldn't
0565 // figure it out).
0566 #ifdef PROTOBUF_BUILTIN_CONSTANT_P
0567 #error PROTOBUF_BUILTIN_CONSTANT_P was previously defined
0568 #endif
0569 #if ABSL_HAVE_BUILTIN(__builtin_constant_p)
0570 #define PROTOBUF_BUILTIN_CONSTANT_P(x) __builtin_constant_p(x)
0571 #else
0572 #define PROTOBUF_BUILTIN_CONSTANT_P(x) false
0573 #endif
0574 
0575 #ifdef PROTOBUF_CUSTOM_VTABLE
0576 #error PROTOBUF_CUSTOM_VTABLE was previously defined
0577 #endif
0578 #if !defined(PROTOBUF_CUSTOM_VTABLE)
0579 #define PROTOBUF_VIRTUAL virtual
0580 #define PROTOBUF_OVERRIDE override
0581 #define PROTOBUF_FINAL final
0582 #endif
0583 
0584 // Determines the platforms where descriptor weak messages can be used.
0585 #ifdef PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED
0586 #error PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED was previously defined
0587 #endif
0588 #if defined(__GNUC__) && defined(__clang__) && !defined(__APPLE__) && \
0589     !defined(_MSC_VER) && !defined(_WIN32)
0590 #define PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED
0591 #endif
0592 
0593 
0594 // TODO: Enable the feature by default and remove this flag.
0595 #ifdef PROTOBUF_PREFETCH_PARSE_TABLE
0596 #error PROTOBUF_PREFETCH_PARSE_TABLE was previously defined
0597 #endif
0598 
0599 #ifdef PROTOBUF_PREFETCH_WITH_OFFSET
0600 #error PROTOBUF_PREFETCH_WITH_OFFSET was previously defined
0601 #endif
0602 #if defined(__x86_64__) && defined(__GNUC__)
0603 #define PROTOBUF_PREFETCH_WITH_OFFSET(base, offset) \
0604   asm("prefetcht0 " #offset "(%0)" : : "r"(base));
0605 #else
0606 #define PROTOBUF_PREFETCH_WITH_OFFSET(base, offset)
0607 #endif
0608 
0609 // ThreadSafeArenaz is turned off completely in opensource builds.
0610 
0611 
0612 // noreturn is defined as a macro in C's stdnoreturn.h
0613 #ifdef noreturn
0614 #define PROTOBUF_DID_UNDEF_noreturn
0615 #pragma push_macro("noreturn")
0616 #undef noreturn
0617 #endif
0618 
0619 // autoheader defines this in some circumstances
0620 #ifdef PACKAGE
0621 #define PROTOBUF_DID_UNDEF_PACKAGE
0622 #pragma push_macro("PACKAGE")
0623 #undef PACKAGE
0624 #endif
0625 
0626 // a few common headers define this
0627 #ifdef PACKED
0628 #define PROTOBUF_DID_UNDEF_PACKED
0629 #pragma push_macro("PACKED")
0630 #undef PACKED
0631 #endif
0632 
0633 // This is a macro on Windows, macOS, and some variants of GCC.
0634 #ifdef DOMAIN
0635 #define PROTOBUF_DID_UNDEF_DOMAIN
0636 #pragma push_macro("DOMAIN")
0637 #undef DOMAIN
0638 #endif
0639 
0640 // linux is a legacy MACRO defined in most popular C++ standards.
0641 #ifdef linux
0642 #pragma push_macro("linux")
0643 #undef linux
0644 #define PROTOBUF_DID_UNDEF_LINUX
0645 #endif
0646 
0647 // netdb.h defines this on some platforms.
0648 #ifdef NO_DATA
0649 #pragma push_macro("NO_DATA")
0650 #undef NO_DATA
0651 #define PROTOBUF_DID_UNDEF_NO_DATA
0652 #endif
0653 
0654 // Windows declares several inconvenient macro names.  We #undef them and then
0655 // restore them in port_undef.inc.
0656 #ifdef _WIN32
0657 #pragma push_macro("CompareString")
0658 #undef CompareString
0659 #pragma push_macro("CREATE_NEW")
0660 #undef CREATE_NEW
0661 #pragma push_macro("DELETE")
0662 #undef DELETE
0663 #pragma push_macro("DOUBLE_CLICK")
0664 #undef DOUBLE_CLICK
0665 #pragma push_macro("ERROR")
0666 #undef ERROR
0667 #pragma push_macro("ERROR_BUSY")
0668 #undef ERROR_BUSY
0669 #pragma push_macro("ERROR_INSTALL_FAILED")
0670 #undef ERROR_INSTALL_FAILED
0671 #pragma push_macro("ERROR_NOT_FOUND")
0672 #undef ERROR_NOT_FOUND
0673 #pragma push_macro("ERROR_RETRY")
0674 #undef ERROR_RETRY
0675 #pragma push_macro("ERROR_TIMEOUT")
0676 #undef ERROR_TIMEOUT
0677 #pragma push_macro("GetClassName")
0678 #undef GetClassName
0679 #pragma push_macro("GetCurrentTime")
0680 #undef GetCurrentTime
0681 #pragma push_macro("GetMessage")
0682 #undef GetMessage
0683 #pragma push_macro("GetObject")
0684 #undef GetObject
0685 #pragma push_macro("IGNORE")
0686 #undef IGNORE
0687 #pragma push_macro("IN")
0688 #undef IN
0689 #pragma push_macro("INPUT_KEYBOARD")
0690 #undef INPUT_KEYBOARD
0691 #pragma push_macro("NO_ERROR")
0692 #undef NO_ERROR
0693 #pragma push_macro("OUT")
0694 #undef OUT
0695 #pragma push_macro("OPTIONAL")
0696 #undef OPTIONAL
0697 #pragma push_macro("min")
0698 #undef min
0699 #pragma push_macro("max")
0700 #undef max
0701 #pragma push_macro("NEAR")
0702 #undef NEAR
0703 #pragma push_macro("NO_DATA")
0704 #undef NO_DATA
0705 #pragma push_macro("REASON_UNKNOWN")
0706 #undef REASON_UNKNOWN
0707 #pragma push_macro("SERVICE_DISABLED")
0708 #undef SERVICE_DISABLED
0709 #pragma push_macro("SERVICE_STOP")
0710 #undef SERVICE_STOP
0711 #pragma push_macro("SEVERITY_ERROR")
0712 #undef SEVERITY_ERROR
0713 #pragma push_macro("STATUS_PENDING")
0714 #undef STATUS_PENDING
0715 #pragma push_macro("STRICT")
0716 #undef STRICT
0717 #pragma push_macro("timezone")
0718 #undef timezone
0719 #pragma push_macro("TRUE")
0720 #undef TRUE
0721 #pragma push_macro("FALSE")
0722 #undef FALSE
0723 #endif  // _WIN32
0724 
0725 #ifdef __APPLE__
0726 // Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs.
0727 #pragma push_macro("TRUE")
0728 #undef TRUE
0729 #pragma push_macro("FALSE")
0730 #undef FALSE
0731 // Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs.
0732 #pragma push_macro("UID_MAX")
0733 #undef UID_MAX
0734 #pragma push_macro("GID_MAX")
0735 #undef GID_MAX
0736 // TYPE_BOOL is defined in the MacOS's ConditionalMacros.h.
0737 #pragma push_macro("TYPE_BOOL")
0738 #undef TYPE_BOOL
0739 #endif  // __APPLE__
0740 
0741 #if defined(ANDROID) || defined(__ANDROID__)
0742 // Inconvenient macro names from usr/include/limits.h in some Android NDKs.
0743 #pragma push_macro("UID_MAX")
0744 #undef UID_MAX
0745 #pragma push_macro("GID_MAX")
0746 #undef GID_MAX
0747 #endif  // defined(ANDROID) || defined(__ANDROID__)
0748 
0749 #ifdef __FreeBSD__
0750 // Inconvenient macro names from /usr/include/sys/param.h.
0751 #pragma push_macro("TRUE")
0752 #undef TRUE
0753 #pragma push_macro("FALSE")
0754 #undef FALSE
0755 // Inconvenient macro names from /usr/include/sys/limits.h.
0756 #pragma push_macro("UID_MAX")
0757 #undef UID_MAX
0758 #pragma push_macro("GID_MAX")
0759 #undef GID_MAX
0760 #endif  // __FreeBSD__
0761 
0762 #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER)
0763 // Don't let Objective-C Macros interfere with proto identifiers with the same
0764 // name.
0765 #pragma push_macro("DEBUG")
0766 #undef DEBUG
0767 #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER)
0768 
0769 // Protobuf does not support building with a number of warnings that are noisy
0770 // (and of variable quality across compiler versions) or impossible to implement
0771 // effectively but which people turn on anyways.
0772 #ifdef __clang__
0773 #pragma clang diagnostic push
0774 // -Wshorten-64-to-32 is a typical pain where we diff pointers.
0775 //   char* p = strchr(s, '\n');
0776 //   return p ? p - s : -1;
0777 #pragma clang diagnostic ignored "-Wshorten-64-to-32"
0778 // Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20
0779 // via http://wg21.link/p1120r0.
0780 #pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
0781 // Turn on -Wconstant-conversion which is used in chromiumos_x86_64 builds.
0782 #pragma clang diagnostic error "-Wconstant-conversion"
0783 // Turn on -Wunused-label which is used in chromiumos_x86_64 builds.
0784 #pragma clang diagnostic error "-Wunused-label"
0785 // This error has been generally flaky, but we need to disable it specifically
0786 // to fix https://github.com/protocolbuffers/protobuf/issues/12313
0787 #pragma clang diagnostic ignored "-Wunused-parameter"
0788 // -Wshadow means that declaration shadows a variable.
0789 // for (int i = 0; i < file_->public_dependency_count(); ++i)
0790 //   for (int i = 0; i < public_dep->message_type_count(); ++i)
0791 #pragma clang diagnostic ignored "-Wshadow"
0792 #pragma clang diagnostic ignored "-Wextra-semi"
0793 // Ensure we don't regress nullability annotations (related: b/383569842)
0794 #pragma clang diagnostic error "-Wnullability-completeness"
0795 #endif
0796 #ifdef __GNUC__
0797 #pragma GCC diagnostic push
0798 // Some of the warnings below only exist in some GCC versions; those version
0799 // ranges are poorly documented.
0800 #pragma GCC diagnostic ignored "-Wpragmas"
0801 // GCC does not allow disabling diagnostics within an expression:
0802 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60875, so we disable this one
0803 // globally even though it's only used for PROTOBUF_FIELD_OFFSET.
0804 #pragma GCC diagnostic ignored "-Winvalid-offsetof"
0805 // Some versions of GCC seem to think that
0806 //  [this] { Foo(); }
0807 // leaves `this` unused, even though `Foo();` is a member function of the
0808 // captured `this`.
0809 // https://bugzilla.mozilla.org/show_bug.cgi?id=1373625
0810 #pragma GCC diagnostic ignored "-Wunused-lambda-capture"
0811 // GCC complains when attributes are specified on anything other than the first
0812 // declaration for enums, even if they all specify the same set.
0813 // Eg this would trigger the warning:
0814 //   enum [[deprecated]] foo : int;
0815 //   enum [[deprecated]] foo : int;
0816 #pragma GCC diagnostic ignored "-Wattributes"
0817 // -Wsign-conversion causes a lot of warnings on mostly code like:
0818 //   int index = ...
0819 //   int value = vec[index];
0820 #pragma GCC diagnostic ignored "-Wsign-conversion"
0821 // This error has been generally flaky, but we need to disable it specifically
0822 // to fix https://github.com/protocolbuffers/protobuf/issues/12313
0823 #pragma GCC diagnostic ignored "-Wunused-parameter"
0824 // -Wshadow means that declaration shadows a variable.
0825 // for (int i = 0; i < file_->public_dependency_count(); ++i)
0826 //   for (int i = 0; i < public_dep->message_type_count(); ++i)
0827 #pragma GCC diagnostic ignored "-Wshadow"
0828 #ifndef __clang__
0829 // This causes spurious warnings in GCC 13.
0830 #pragma GCC diagnostic ignored "-Wstringop-overflow"
0831 // This causes spurious warnings in GCC 13.
0832 #pragma GCC diagnostic ignored "-Wself-move"
0833 // Ignore warning: extra ';' [-Wpedantic]
0834 #pragma GCC diagnostic ignored "-Wpedantic"
0835 #endif
0836 #if __GNUC__ == 12 && __GNUC_MINOR__ < 4
0837 // Wrong warning emitted when assigning a single char c-string to a std::string
0838 // in c++20 mode and optimization on.
0839 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
0840 // Planned to be fixed by 12.3 but widen window to 12.4.
0841 #pragma GCC diagnostic ignored "-Wrestrict"
0842 #endif
0843 #endif  // __GNUC__
0844 
0845 // Silence some MSVC warnings in all our code.
0846 #ifdef _MSC_VER
0847 #pragma warning(push)
0848 // For non-trivial unions
0849 #pragma warning(disable : 4582)
0850 #pragma warning(disable : 4583)
0851 // For init_seg(lib)
0852 #pragma warning(disable : 4073)
0853 // To silence the fact that we will pop this push from another file
0854 #pragma warning(disable : 5031)
0855 // Conditional expression is constant
0856 #pragma warning(disable: 4127)
0857 // decimal digit terminates octal escape sequence
0858 #pragma warning(disable: 4125)
0859 #endif
0860 
0861 #if defined(PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII) && \
0862     PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII
0863 #define PROTOBUF_DEBUG true
0864 #else
0865 #define PROTOBUF_DEBUG false
0866 #endif
0867 
0868 #ifdef PROTOBUF_NO_THREADLOCAL
0869 #error PROTOBUF_NO_THREADLOCAL was previously defined
0870 #endif
0871 
0872 // port_def.inc may be included in very large compilation targets, so we need to
0873 // minimize adding symbol and source file information here. For this reason we
0874 // implement our own simple `protobuf_assumption_failed()` function for
0875 // asserting PROTOBUF_ASSUME predicates in debug builds.
0876 namespace google {
0877 namespace protobuf {
0878 namespace internal {
0879 [[noreturn]] PROTOBUF_EXPORT void protobuf_assumption_failed(const char *pred,
0880                                                              const char *file,
0881                                                              int line);
0882 }  // namespace internal
0883 }  // namespace protobuf
0884 }  // namespace google
0885 
0886 // PROTOBUF_ASSUME(pred) tells the compiler that it can assume pred is true.
0887 // To be safe, we also validate the assumption in debug builds, printing an
0888 // assert style "Assumption failed: ..." message and aborting the program if
0889 // the predicate is false. The macro does not do anything useful if the
0890 // compiler does not support __builtin_assume.
0891 #ifdef PROTOBUF_ASSUME
0892 #error PROTOBUF_ASSUME was previously defined
0893 #endif
0894 #if ABSL_HAVE_BUILTIN(__builtin_assume)
0895 #ifdef NDEBUG
0896 #define PROTOBUF_ASSUME(pred) __builtin_assume(pred)
0897 #else  // NDEBUG
0898 #define PROTOBUF_ASSUME(pred)                                                  \
0899   if (!(pred)) {                                                               \
0900     ::google::protobuf::internal::protobuf_assumption_failed(#pred, __FILE__, __LINE__); \
0901   }                                                                            \
0902   __builtin_assume(pred)
0903 #endif  // NDEBUG
0904 #else   // has_builtin(__builtin_assume)
0905 #ifndef NDEBUG
0906 #define PROTOBUF_ASSUME(pred)                                                  \
0907   if (!(pred)) {                                                               \
0908     ::google::protobuf::internal::protobuf_assumption_failed(#pred, __FILE__, __LINE__); \
0909   }
0910 #else  // !NDEBUG
0911 #define PROTOBUF_ASSUME(pred)
0912 #endif  // !NDEBUG
0913 #endif  // has_builtin(__builtin_assume)
0914 
0915 // PROTOBUF_EXPECT_TRUE_WITH_PROBABILITY(expr, prob) tells the compiler that
0916 // the expression expr is likely to be true with probability prob. This is
0917 // helpful for the compiler to make better optimization decisions when we know
0918 // the probability of a certain branch (e.g. from a profile).
0919 #ifdef PROTOBUF_EXPECT_TRUE_WITH_PROBABILITY
0920 #error PROTOBUF_EXPECT_TRUE_WITH_PROBABILITY was previously defined
0921 #endif
0922 #if ABSL_HAVE_BUILTIN(__builtin_expect_with_probability)
0923 #define PROTOBUF_EXPECT_TRUE_WITH_PROBABILITY(expr, prob) \
0924   __builtin_expect_with_probability((expr), 1, (prob))
0925 #else
0926 #define PROTOBUF_EXPECT_TRUE_WITH_PROBABILITY(expr, prob) (expr)
0927 #endif
0928 
0929 #ifdef PROTOBUF_DEPRECATE_AND_INLINE
0930 #error PROTOBUF_DEPRECATE_AND_INLINE was previously defined
0931 #endif
0932 #if defined(ABSL_DEPRECATE_AND_INLINE)
0933 #define PROTOBUF_DEPRECATE_AND_INLINE() ABSL_DEPRECATE_AND_INLINE()
0934 #else
0935 #define PROTOBUF_DEPRECATE_AND_INLINE() [[deprecated]]
0936 #endif
0937 
0938 #ifdef PROTOBUF_NONNULL
0939 #error PROTOBUF_NONNULL was previously defined
0940 #endif
0941 #ifndef PROTOBUF_NONNULL
0942 #define PROTOBUF_NONNULL
0943 #define PROTOBUF_NULLABLE
0944 #endif
0945 
0946 namespace google {
0947 namespace protobuf {
0948 namespace internal {
0949 #if defined(PROTOBUF_INTERNAL_ENABLE_DEBUG_COUNTERS)
0950 #define PROTOBUF_DEBUG_COUNTER(name)                                   \
0951   ([]() -> auto & {                                                    \
0952     static constexpr const char *counter_name = name;                  \
0953     static ::google::protobuf::internal::RealDebugCounter counter(counter_name); \
0954     return counter;                                                    \
0955   }())
0956 
0957 #else  // PROTOBUF_ENABLE_DEBUG_COUNTERS
0958 #define PROTOBUF_DEBUG_COUNTER(name) \
0959   ::google::protobuf::internal::NoopDebugCounter {}
0960 #endif  // PROTOBUF_ENABLE_DEBUG_COUNTERS
0961 }  // namespace internal
0962 }  // namespace protobuf
0963 }  // namespace google