|
67 | 67 | // - MSVC: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-history |
68 | 68 | // https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes-history |
69 | 69 |
|
70 | | -// Portable fallback for Clang's __has_warning macro: |
71 | | -#ifndef __has_warning |
72 | | -#define __has_warning(x) 0 |
73 | | -#define PROTOBUF_has_warning_DEFINED_ |
74 | | -#endif |
75 | | - |
76 | 70 | // Portable PROTOBUF_BUILTIN_BSWAPxx definitions |
77 | 71 | // Code must check for availability, e.g.: `defined(PROTOBUF_BUILTIN_BSWAP32)` |
78 | 72 | #ifdef PROTOBUF_BUILTIN_BSWAP16 |
|
94 | 88 | #define PROTOBUF_BUILTIN_BSWAP64(x) __builtin_bswap64(x) |
95 | 89 | #endif |
96 | 90 |
|
97 | | -// Portable check for __builtin_mul_overflow. |
98 | | -#if ABSL_HAVE_BUILTIN(__builtin_mul_overflow) |
99 | | -#define PROTOBUF_HAS_BUILTIN_MUL_OVERFLOW 1 |
100 | | -#endif |
101 | | - |
102 | 91 | // Portable check for gcc-style atomic built-ins |
103 | 92 | #if ABSL_HAVE_BUILTIN(__atomic_load_n) |
104 | 93 | #define PROTOBUF_BUILTIN_ATOMIC 1 |
@@ -512,11 +501,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), |
512 | 501 | #define PROTOBUF_ALIGNAS(byte_alignment) alignas(byte_alignment) |
513 | 502 | #endif |
514 | 503 |
|
515 | | -#ifdef PROTOBUF_FINAL |
516 | | -#error PROTOBUF_FINAL was previously defined |
517 | | -#endif |
518 | | -#define PROTOBUF_FINAL final |
519 | | - |
520 | 504 | #ifdef PROTOBUF_THREAD_LOCAL |
521 | 505 | #error PROTOBUF_THREAD_LOCAL was previously defined |
522 | 506 | #endif |
@@ -579,21 +563,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), |
579 | 563 | #define PROTOBUF_ATTRIBUTE_NO_DESTROY |
580 | 564 | #endif |
581 | 565 |
|
582 | | -// Force clang to always emit complete debug info for a type. |
583 | | -// Clang uses constructor homing to determine when to emit debug info for a |
584 | | -// type. If the constructor of a type is never used, which can happen in some |
585 | | -// cases where member variables are constructed in place for optimization |
586 | | -// purposes (see b/208803175 for an example), the type will have incomplete |
587 | | -// debug info unless this attribute is used. |
588 | | -#ifdef PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG |
589 | | -#error PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG was previously defined |
590 | | -#endif |
591 | | -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::standalone_debug) |
592 | | -#define PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG [[clang::standalone_debug]] |
593 | | -#else |
594 | | -#define PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG |
595 | | -#endif |
596 | | - |
597 | 566 | // Protobuf extensions and reflection require registration of the protos linked |
598 | 567 | // in the binary. Not until everything is registered does the runtime have a |
599 | 568 | // complete view on all protos. When code is using reflection or extensions |
@@ -1070,10 +1039,3 @@ namespace internal { |
1070 | 1039 | #endif // !NDEBUG |
1071 | 1040 | #endif // has_builtin(__builtin_assume) |
1072 | 1041 |
|
1073 | | -// We don't want code outside port_def doing complex testing, so |
1074 | | -// remove our portable condition test macros to nudge folks away from |
1075 | | -// using it themselves. |
1076 | | -#ifdef PROTOBUF_has_warning_DEFINED_ |
1077 | | -# undef __has_warning |
1078 | | -# undef PROTOBUF_has_warning_DEFINED_ |
1079 | | -#endif |
0 commit comments