84
84
// namespace absl {
85
85
// OTABSL_NAMESPACE_BEGIN
86
86
//
87
- // void Foo(); // absl::Foo().
87
+ // void Foo(); // absl::OTABSL_OPTION_NAMESPACE_NAME:: Foo().
88
88
//
89
89
// OTABSL_NAMESPACE_END
90
90
// } // namespace absl
94
94
// not support forward declarations of its own types, nor does it support
95
95
// user-provided specialization of Abseil templates. Code that violates these
96
96
// rules may be broken without warning.)
97
- #if !defined(OTABSL_OPTION_USE_INLINE_NAMESPACE) || \
98
- !defined (OTABSL_OPTION_INLINE_NAMESPACE_NAME)
97
+ #if !defined(OTABSL_OPTION_NAMESPACE_NAME)
99
98
#error options.h is misconfigured.
100
99
#endif
101
100
102
- // Check that OTABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor ""
103
- #if defined(__cplusplus) && OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
101
+ // Check that OTABSL_OPTION_NAMESPACE_NAME is neither "head" nor ""
102
+ #if defined(__cplusplus)
104
103
105
104
#define OTABSL_INTERNAL_INLINE_NAMESPACE_STR \
106
- OTABSL_INTERNAL_TOKEN_STR (OTABSL_OPTION_INLINE_NAMESPACE_NAME )
105
+ OTABSL_INTERNAL_TOKEN_STR (OTABSL_OPTION_NAMESPACE_NAME )
107
106
108
107
static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0 ] != ' \0 ' ,
109
- " options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
108
+ " options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
110
109
" not be empty." );
111
110
static_assert (OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0 ] != ' h' ||
112
111
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[1 ] != ' e' ||
113
112
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[2 ] != ' a' ||
114
113
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[3 ] != ' d' ||
115
114
OTABSL_INTERNAL_INLINE_NAMESPACE_STR[4 ] != ' \0 ' ,
116
- " options.h misconfigured: OTABSL_OPTION_INLINE_NAMESPACE_NAME must "
115
+ " options.h misconfigured: OTABSL_OPTION_NAMESPACE_NAME must "
117
116
" be changed to a new, unique identifier name." );
118
117
119
118
#endif
120
119
121
- #if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
122
- #define OTABSL_NAMESPACE_BEGIN
123
- #define OTABSL_NAMESPACE_END
124
- #elif OTABSL_OPTION_USE_INLINE_NAMESPACE == 1
125
- #define OTABSL_NAMESPACE_BEGIN \
126
- inline namespace OTABSL_OPTION_INLINE_NAMESPACE_NAME {
120
+
121
+ #define OTABSL_NAMESPACE_BEGIN namespace OTABSL_OPTION_NAMESPACE_NAME {
127
122
#define OTABSL_NAMESPACE_END }
128
- #else
129
- #error options.h is misconfigured.
130
- #endif
131
123
132
124
// -----------------------------------------------------------------------------
133
125
// Compiler Feature Checks
@@ -217,7 +209,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
217
209
218
210
// OTABSL_HAVE_SOURCE_LOCATION_CURRENT
219
211
//
220
- // Indicates whether `absl::SourceLocation::current()` will return useful
212
+ // Indicates whether `absl::OTABSL_OPTION_NAMESPACE_NAME:: SourceLocation::current()` will return useful
221
213
// information in some contexts.
222
214
#ifndef OTABSL_HAVE_SOURCE_LOCATION_CURRENT
223
215
#if OTABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \
@@ -570,7 +562,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
570
562
571
563
// OTABSL_USES_STD_ANY
572
564
//
573
- // Indicates whether absl::any is an alias for std::any.
565
+ // Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME:: any is an alias for std::any.
574
566
#if !defined(OTABSL_OPTION_USE_STD_ANY)
575
567
#error options.h is misconfigured.
576
568
#elif OTABSL_OPTION_USE_STD_ANY == 0 || \
@@ -585,7 +577,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
585
577
586
578
// OTABSL_USES_STD_OPTIONAL
587
579
//
588
- // Indicates whether absl::optional is an alias for std::optional.
580
+ // Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME:: optional is an alias for std::optional.
589
581
#if !defined(OTABSL_OPTION_USE_STD_OPTIONAL)
590
582
#error options.h is misconfigured.
591
583
#elif OTABSL_OPTION_USE_STD_OPTIONAL == 0 || \
@@ -600,7 +592,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
600
592
601
593
// OTABSL_USES_STD_VARIANT
602
594
//
603
- // Indicates whether absl::variant is an alias for std::variant.
595
+ // Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME:: variant is an alias for std::variant.
604
596
#if !defined(OTABSL_OPTION_USE_STD_VARIANT)
605
597
#error options.h is misconfigured.
606
598
#elif OTABSL_OPTION_USE_STD_VARIANT == 0 || \
@@ -615,7 +607,7 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
615
607
616
608
// OTABSL_USES_STD_STRING_VIEW
617
609
//
618
- // Indicates whether absl::string_view is an alias for std::string_view.
610
+ // Indicates whether absl::OTABSL_OPTION_NAMESPACE_NAME:: string_view is an alias for std::string_view.
619
611
#if !defined(OTABSL_OPTION_USE_STD_STRING_VIEW)
620
612
#error options.h is misconfigured.
621
613
#elif OTABSL_OPTION_USE_STD_STRING_VIEW == 0 || \
@@ -650,15 +642,10 @@ static_assert(OTABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
650
642
// the proper count to skip past the CCTZ fork namespace names. (This number
651
643
// is one larger when there is an inline namespace name to skip.)
652
644
#if defined(_MSC_VER)
653
- #if OTABSL_OPTION_USE_INLINE_NAMESPACE == 0
654
- #define OTABSL_INTERNAL_MANGLED_NS " absl"
655
- #define OTABSL_INTERNAL_MANGLED_BACKREFERENCE " 5"
656
- #else
657
645
#define OTABSL_INTERNAL_MANGLED_NS \
658
- OTABSL_INTERNAL_TOKEN_STR (OTABSL_OPTION_INLINE_NAMESPACE_NAME ) "@absl"
646
+ OTABSL_INTERNAL_TOKEN_STR (OTABSL_OPTION_NAMESPACE_NAME ) "@absl"
659
647
#define OTABSL_INTERNAL_MANGLED_BACKREFERENCE " 6"
660
648
#endif
661
- #endif
662
649
663
650
#undef OTABSL_INTERNAL_HAS_KEYWORD
664
651
0 commit comments