From 6b4ac669629d7adf821700ae9284b057dd1907d8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 26 Dec 2014 13:29:44 +0100 Subject: [PATCH] Compiler.h: add macro CLANG_CHECK_VERSION() --- src/Compiler.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Compiler.h b/src/Compiler.h index 82a192394..b736b5ac7 100644 --- a/src/Compiler.h +++ b/src/Compiler.h @@ -52,6 +52,13 @@ # warning Untested compiler. Use at your own risk! #endif +/** + * Are we building with the specified version of clang or newer? + */ +#define CLANG_CHECK_VERSION(major, minor) \ + (defined(__clang__) && \ + CLANG_VERSION >= GCC_MAKE_VERSION(major, minor, 0)) + #if GCC_CHECK_VERSION(4,0) /* GCC 4.x */