/*
* This was introduced by Clang:
*
- * http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute
+ * https://clang.llvm.org/docs/LanguageExtensions.html#has-attribute
*
* in some version (which version?); it has been picked up by GCC 5.0.
*/
(__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
#endif
+/*
+ * Check whether this is Clang major.minor or a later release.
+ */
+
+#if !defined(__clang__)
+#define ND_IS_AT_LEAST_CLANG_VERSION(major, minor) 0
+#else
+#define ND_IS_AT_LEAST_CLANG_VERSION(major, minor) \
+ (__clang_major__ > (major) || \
+ (__clang_major__ == (major) && __clang_minor__ >= (minor)))
+#endif
+
/*
* Check whether this is Sun C/SunPro C/Oracle Studio major.minor
* or a later release.
*
* The version number in __xlC__ has the major version in the
* upper 8 bits and the minor version in the lower 8 bits.
+ * On AIX __xlC__ is always defined, __ibmxl__ becomes defined in XL C 16.1.
+ * On Linux since XL C 13.1.6 __xlC__ is not defined by default anymore, but
+ * __ibmxl__ is defined since at least XL C 13.1.1.
*/
#if ! defined(__xlC__)
+#if ! defined(__ibmxl__)
#define ND_IS_AT_LEAST_XL_C_VERSION(major,minor) 0
#else
+#define ND_IS_AT_LEAST_XL_C_VERSION(major, minor) \
+ (__ibmxl_version__ > (major) || \
+ (__ibmxl_version__ == (major) && __ibmxl_release__ >= (minor)))
+#endif /* ! __ibmxl__ */
+#else /* ! __xlC__ */
#define ND_IS_AT_LEAST_XL_C_VERSION(major, minor) \
(__xlC__ >= (((major) << 8) | (minor)))
#endif