- Timestamp:
- Jul 6, 2020 1:01:22 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/include/iprt/cdefs.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cdefs.h
r84527 r85069 231 231 * @param a_MinMinor The minor version number part. 232 232 */ 233 #define RT_CLANG_PREREQ(a_MinMajor, a_MinMinor) RT_CLANG_PREREQ_EX(a_MinMajor, a_MinMinor, 0)233 #define RT_CLANG_PREREQ(a_MinMajor, a_MinMinor) RT_CLANG_PREREQ_EX(a_MinMajor, a_MinMinor, 0) 234 234 /** @def RT_CLANG_PREREQ_EX 235 235 * Simplified way of checking __clang_major__ and __clang_minor__ regardless of … … 245 245 #else 246 246 # define RT_CLANG_PREREQ_EX(a_MinMajor, a_MinMinor, a_OtherRet) (a_OtherRet) 247 #endif 248 /** @def RT_CLANG_HAS_FEATURE 249 * Wrapper around clang's __has_feature(). 250 * 251 * @param a_Feature The feature to check for. 252 */ 253 #if defined(__clang_major__) && defined(__clang_minor__) && defined(__has_feature) 254 # define RT_CLANG_HAS_FEATURE(a_Feature) (__has_feature(a_Feature)) 255 #else 256 # define RT_CLANG_HAS_FEATURE(a_Feature) (0) 247 257 #endif 248 258 … … 1063 1073 1064 1074 /** @def RT_NO_THROW_PROTO 1065 * How to express that a function doesn't throw C++ exceptions 1066 * and the compiler can thus save itself the bother of trying1067 * to catch any of them. Put this between the closing parenthesis1068 * and the semicolon infunction prototypes (and implementation if C++).1075 * How to express that a function doesn't throw C++ exceptions and the compiler 1076 * can thus save itself the bother of trying to catch any of them and generate 1077 * unwind info. Put this between the closing parenthesis and the semicolon in 1078 * function prototypes (and implementation if C++). 1069 1079 * 1070 1080 * @remarks May not work on C++ methods, mainly intented for C-style APIs. … … 1075 1085 * macros, as the nothrow attribute is not for the function definition. 1076 1086 */ 1087 /** @def RT_NO_THROW_DEF 1088 * The counter part to RT_NO_THROW_PROTO that is added to the function 1089 * definition. 1090 */ 1077 1091 #ifdef RT_EXCEPTIONS_ENABLED 1078 # ifdef __GNUC__ 1092 # if RT_MSC_PREREQ_EX(RT_MSC_VER_VS2015, 0) \ 1093 || RT_CLANG_HAS_FEATURE(cxx_noexcept) \ 1094 || (RT_GNUC_PREREQ(7, 0) && __cplusplus >= 201100) 1095 # define RT_NO_THROW_PROTO noexcept 1096 # define RT_NO_THROW_DEF noexcept 1097 # elif defined(__GNUC__) 1079 1098 # if RT_GNUC_PREREQ(3, 3) 1080 1099 # define RT_NO_THROW_PROTO __attribute__((__nothrow__)) … … 1082 1101 # define RT_NO_THROW_PROTO 1083 1102 # endif 1103 # define RT_NO_THROW_DEF /* Would need a DECL_NO_THROW like __declspec(nothrow), which we wont do at this point. */ 1084 1104 # else 1085 1105 # define RT_NO_THROW_PROTO throw() 1106 # define RT_NO_THROW_DEF throw() 1086 1107 # endif 1087 1108 #else 1088 1109 # define RT_NO_THROW_PROTO 1089 #endif1090 1091 /** @def RT_NO_THROW_DEF1092 * The counter part to RT_NO_THROW_PROTO that is added to the function1093 * definition.1094 */1095 #if defined(RT_EXCEPTIONS_ENABLED) && !defined(__GNUC__)1096 # define RT_NO_THROW_DEF RT_NO_THROW_PROTO1097 #else1098 1110 # define RT_NO_THROW_DEF 1099 1111 #endif
Note:
See TracChangeset
for help on using the changeset viewer.

