Move __CLANG_PREREQ to folly/CPortabiilty.h
[folly.git] / folly / CPortability.h
index 1a47d2518ad6d447260da0a4c6e4ef69cd2c1f34..ca5070a0f551991d6bf541c775aab7798f0458be 100644 (file)
 # endif
 #endif
 
+// portable version check for clang
+#ifndef __CLANG_PREREQ
+# if defined __clang__ && defined __clang_major__ && defined __clang_minor__
+/* nolint */
+#  define __CLANG_PREREQ(maj, min) \
+    ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
+# else
+/* nolint */
+#  define __CLANG_PREREQ(maj, min) 0
+# endif
+#endif
+
 /* Define a convenience macro to test when address sanitizer is being used
  * across the different compilers (e.g. clang, gcc) */
 #if defined(__clang__)