1 #ifndef RBIMPL_HAS_CPP_ATTRIBUTE_H
2 #define RBIMPL_HAS_CPP_ATTRIBUTE_H
27 #if RBIMPL_COMPILER_IS(SunPro)
34 # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) 0
36 #elif defined(__has_cpp_attribute)
37 # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_)
39 #elif RBIMPL_COMPILER_IS(MSVC)
44 # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) (RBIMPL_HAS_CPP_ATTRIBUTE_ ## _)
45 # define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 0)
46 # define RBIMPL_HAS_CPP_ATTRIBUTE_carries_dependency 200809 * RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 0)
47 # define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(MSVC, 19, 10, 0)
48 # define RBIMPL_HAS_CPP_ATTRIBUTE_fallthrough 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 10, 0)
49 # define RBIMPL_HAS_CPP_ATTRIBUTE_maybe_unused 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 0)
50 # define RBIMPL_HAS_CPP_ATTRIBUTE_nodiscard 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 0)
52 #elif RBIMPL_COMPILER_BEFORE(Clang, 3, 6, 0)
56 # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) (RBIMPL_HAS_CPP_ATTRIBUTE_ ## _)
57 # define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(Clang, 3, 3, 0)
58 # define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(Clang, 3, 4, 0)
60 #elif RBIMPL_COMPILER_BEFORE(GCC, 5, 0, 0)
63 # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) (RBIMPL_HAS_CPP_ATTRIBUTE_ ## _)
64 # define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
65 # define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
72 # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) 0
77 #if ! defined(__cplusplus)
79 # define RBIMPL_HAS_CPP_ATTRIBUTE(_) 0
82 # define RBIMPL_HAS_CPP_ATTRIBUTE(_) \
83 ((RBIMPL_HAS_CPP_ATTRIBUTE0(_) <= __cplusplus) ? RBIMPL_HAS_CPP_ATTRIBUTE0(_) : 0)
Defines RBIMPL_COMPILER_IS.
Defines RBIMPL_COMPILER_SINCE.