diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -496,6 +496,10 @@ #define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER #endif +#if __has_builtin(__builtin_constant_p) +#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P +#endif + #if !__is_identifier(__has_unique_object_representations) #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS #endif @@ -539,6 +543,10 @@ #define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER #endif +#if _GNUC_VER >= 700 +#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P +#endif + #if _GNUC_VER >= 700 #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS #endif @@ -1527,6 +1535,12 @@ # define _LIBCPP_FOPEN_CLOEXEC_MODE #endif +#ifdef _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P +#define _LIBCPP_BUILTIN_CONSTANT_P(x) __builtin_constant_p(x) +#else +#define _LIBCPP_BUILTIN_CONSTANT_P(x) false +#endif + #endif // __cplusplus #endif // _LIBCPP_CONFIG