xref: /aosp_15_r20/external/abseil-cpp/absl/flags/config.h (revision 9356374a3709195abf420251b3e825997ff56c0f)
1*9356374aSAndroid Build Coastguard Worker //
2*9356374aSAndroid Build Coastguard Worker //  Copyright 2019 The Abseil Authors.
3*9356374aSAndroid Build Coastguard Worker //
4*9356374aSAndroid Build Coastguard Worker // Licensed under the Apache License, Version 2.0 (the "License");
5*9356374aSAndroid Build Coastguard Worker // you may not use this file except in compliance with the License.
6*9356374aSAndroid Build Coastguard Worker // You may obtain a copy of the License at
7*9356374aSAndroid Build Coastguard Worker //
8*9356374aSAndroid Build Coastguard Worker //      https://www.apache.org/licenses/LICENSE-2.0
9*9356374aSAndroid Build Coastguard Worker //
10*9356374aSAndroid Build Coastguard Worker // Unless required by applicable law or agreed to in writing, software
11*9356374aSAndroid Build Coastguard Worker // distributed under the License is distributed on an "AS IS" BASIS,
12*9356374aSAndroid Build Coastguard Worker // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*9356374aSAndroid Build Coastguard Worker // See the License for the specific language governing permissions and
14*9356374aSAndroid Build Coastguard Worker // limitations under the License.
15*9356374aSAndroid Build Coastguard Worker 
16*9356374aSAndroid Build Coastguard Worker #ifndef ABSL_FLAGS_CONFIG_H_
17*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_CONFIG_H_
18*9356374aSAndroid Build Coastguard Worker 
19*9356374aSAndroid Build Coastguard Worker // Determine if we should strip string literals from the Flag objects.
20*9356374aSAndroid Build Coastguard Worker // By default we strip string literals on mobile platforms.
21*9356374aSAndroid Build Coastguard Worker #if !defined(ABSL_FLAGS_STRIP_NAMES)
22*9356374aSAndroid Build Coastguard Worker 
23*9356374aSAndroid Build Coastguard Worker #if defined(__ANDROID__)
24*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_STRIP_NAMES 1
25*9356374aSAndroid Build Coastguard Worker 
26*9356374aSAndroid Build Coastguard Worker #elif defined(__APPLE__)
27*9356374aSAndroid Build Coastguard Worker #include <TargetConditionals.h>
28*9356374aSAndroid Build Coastguard Worker #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
29*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_STRIP_NAMES 1
30*9356374aSAndroid Build Coastguard Worker #elif defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED
31*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_STRIP_NAMES 1
32*9356374aSAndroid Build Coastguard Worker #endif  // TARGET_OS_*
33*9356374aSAndroid Build Coastguard Worker #endif
34*9356374aSAndroid Build Coastguard Worker 
35*9356374aSAndroid Build Coastguard Worker #endif  // !defined(ABSL_FLAGS_STRIP_NAMES)
36*9356374aSAndroid Build Coastguard Worker 
37*9356374aSAndroid Build Coastguard Worker #if !defined(ABSL_FLAGS_STRIP_NAMES)
38*9356374aSAndroid Build Coastguard Worker // If ABSL_FLAGS_STRIP_NAMES wasn't set on the command line or above,
39*9356374aSAndroid Build Coastguard Worker // the default is not to strip.
40*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_STRIP_NAMES 0
41*9356374aSAndroid Build Coastguard Worker #endif
42*9356374aSAndroid Build Coastguard Worker 
43*9356374aSAndroid Build Coastguard Worker #if !defined(ABSL_FLAGS_STRIP_HELP)
44*9356374aSAndroid Build Coastguard Worker // By default, if we strip names, we also strip help.
45*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_STRIP_HELP ABSL_FLAGS_STRIP_NAMES
46*9356374aSAndroid Build Coastguard Worker #endif
47*9356374aSAndroid Build Coastguard Worker 
48*9356374aSAndroid Build Coastguard Worker // These macros represent the "source of truth" for the list of supported
49*9356374aSAndroid Build Coastguard Worker // built-in types.
50*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_INTERNAL_BUILTIN_TYPES(A) \
51*9356374aSAndroid Build Coastguard Worker   A(bool, bool)                              \
52*9356374aSAndroid Build Coastguard Worker   A(short, short)                            \
53*9356374aSAndroid Build Coastguard Worker   A(unsigned short, unsigned_short)          \
54*9356374aSAndroid Build Coastguard Worker   A(int, int)                                \
55*9356374aSAndroid Build Coastguard Worker   A(unsigned int, unsigned_int)              \
56*9356374aSAndroid Build Coastguard Worker   A(long, long)                              \
57*9356374aSAndroid Build Coastguard Worker   A(unsigned long, unsigned_long)            \
58*9356374aSAndroid Build Coastguard Worker   A(long long, long_long)                    \
59*9356374aSAndroid Build Coastguard Worker   A(unsigned long long, unsigned_long_long)  \
60*9356374aSAndroid Build Coastguard Worker   A(double, double)                          \
61*9356374aSAndroid Build Coastguard Worker   A(float, float)
62*9356374aSAndroid Build Coastguard Worker 
63*9356374aSAndroid Build Coastguard Worker #define ABSL_FLAGS_INTERNAL_SUPPORTED_TYPES(A) \
64*9356374aSAndroid Build Coastguard Worker   ABSL_FLAGS_INTERNAL_BUILTIN_TYPES(A)         \
65*9356374aSAndroid Build Coastguard Worker   A(std::string, std_string)                   \
66*9356374aSAndroid Build Coastguard Worker   A(std::vector<std::string>, std_vector_of_string)
67*9356374aSAndroid Build Coastguard Worker 
68*9356374aSAndroid Build Coastguard Worker #endif  // ABSL_FLAGS_CONFIG_H_
69