xref: /aosp_15_r20/frameworks/minikin/libs/minikin/FeatureFlags.h (revision 834a2baab5fdfc28e9a428ee87c7ea8f6a06a53d)
1*834a2baaSAndroid Build Coastguard Worker /*
2*834a2baaSAndroid Build Coastguard Worker  * Copyright (C) 2023 The Android Open Source Project
3*834a2baaSAndroid Build Coastguard Worker  *
4*834a2baaSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*834a2baaSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*834a2baaSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*834a2baaSAndroid Build Coastguard Worker  *
8*834a2baaSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*834a2baaSAndroid Build Coastguard Worker  *
10*834a2baaSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*834a2baaSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*834a2baaSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*834a2baaSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*834a2baaSAndroid Build Coastguard Worker  * limitations under the License.
15*834a2baaSAndroid Build Coastguard Worker  */
16*834a2baaSAndroid Build Coastguard Worker 
17*834a2baaSAndroid Build Coastguard Worker #ifndef MINIKIN_FEATURE_FLAGS_H
18*834a2baaSAndroid Build Coastguard Worker #define MINIKIN_FEATURE_FLAGS_H
19*834a2baaSAndroid Build Coastguard Worker 
20*834a2baaSAndroid Build Coastguard Worker #ifdef __ANDROID__
21*834a2baaSAndroid Build Coastguard Worker #include <com_android_text_flags.h>
22*834a2baaSAndroid Build Coastguard Worker #endif  // __ANDROID__
23*834a2baaSAndroid Build Coastguard Worker 
24*834a2baaSAndroid Build Coastguard Worker namespace features {
25*834a2baaSAndroid Build Coastguard Worker 
26*834a2baaSAndroid Build Coastguard Worker #ifdef __ANDROID__
27*834a2baaSAndroid Build Coastguard Worker #define DEFINE_FEATURE_FLAG_ACCESSOROR(feature_name)                \
28*834a2baaSAndroid Build Coastguard Worker     inline bool feature_name() {                                    \
29*834a2baaSAndroid Build Coastguard Worker         static bool flag = com_android_text_flags_##feature_name(); \
30*834a2baaSAndroid Build Coastguard Worker         return flag;                                                \
31*834a2baaSAndroid Build Coastguard Worker     }
32*834a2baaSAndroid Build Coastguard Worker #else  //  __ANDROID__
33*834a2baaSAndroid Build Coastguard Worker #define DEFINE_FEATURE_FLAG_ACCESSOROR(feature_name) \
34*834a2baaSAndroid Build Coastguard Worker     inline bool feature_name() {                     \
35*834a2baaSAndroid Build Coastguard Worker         return true;                                 \
36*834a2baaSAndroid Build Coastguard Worker     }
37*834a2baaSAndroid Build Coastguard Worker #endif  //  __ANDROID__
38*834a2baaSAndroid Build Coastguard Worker 
39*834a2baaSAndroid Build Coastguard Worker DEFINE_FEATURE_FLAG_ACCESSOROR(rust_hyphenator);
40*834a2baaSAndroid Build Coastguard Worker DEFINE_FEATURE_FLAG_ACCESSOROR(typeface_redesign_readonly);
41*834a2baaSAndroid Build Coastguard Worker 
42*834a2baaSAndroid Build Coastguard Worker }  // namespace features
43*834a2baaSAndroid Build Coastguard Worker 
44*834a2baaSAndroid Build Coastguard Worker #endif  // FEATURE_FLAGS
45