The normal case of this is already rejected by the .proto parser, this additional check covers legacy_closed_enum cases. Those cases will otherwise reach a CHECK-fail, this just makes for a clearer error message that this is simply a disallowed combination.
PiperOrigin-RevId: 696648744
To implement extensions in Rust, we are going to need a symbol we can depend on
to force-link the C++ extension registration code. The `descriptor_table_xxxxx`
variable seems ideal for this: it already exists and is not public-facing, so
we can reuse it without increasing code size. This CL marks it `extern "C"` to
ensure that we can safely access it from Rust.
PiperOrigin-RevId: 696615312
The intent of these checks was that if the C++20 version of this feature
are enabled to execute the top codepath. libstdc++ 12 defines this
feature as:
```cpp
// in: /usr/include/c++/12/bits/basic_string.h
#ifdef __cpp_lib_is_constant_evaluated
// Support P0980R1 in C++20.
# define __cpp_lib_constexpr_string 201907L
#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
// Support P0426R1 changes to char_traits in C++17.
# define __cpp_lib_constexpr_string 201611L
#endif
```
So this codepath was always being hit even with -std=c++17 and then
resulted in a failure because the string wasn't actually constinit. This
matches the other use of this feature check in `inlined_string_field.h`
Closes#18890
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18890 from keith:ks/fix-uses-of-__cpp_lib_constexpr_string edb4f5f6b6
PiperOrigin-RevId: 696526963
This will fix https://github.com/protocolbuffers/protobuf/issues/15957 by not trying to use CLOCK_UPTIME_RAW if the feature test macros are not currently set to make it available.
Since the build system is in charge of the feature test macros, and since this header might be included under any end user program's build system, we can't just #define the macros we would like.
Closes#16951
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16951 from adamnovak:patch-1 cebf44ed71
PiperOrigin-RevId: 696251619