config.h 2.3 KB

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