From fe38ffcd808c5c4255c24c6b6273d6e8fdce4ee6 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 13 Jun 2012 14:43:27 +1000 Subject: [PATCH] Add compiler check in platform.hpp --- platform.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/platform.hpp b/platform.hpp index 904c23cf..c8c57f9e 100644 --- a/platform.hpp +++ b/platform.hpp @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with libgim. If not, see . * - * Copyright 2010-2012 Danny Robson + * Copyright 2012 Danny Robson */ #ifndef __UTIL_PLATFORM_HPP @@ -28,4 +28,13 @@ #error "Unknown platform" #endif +// Clang needs to be checked before GCC as it pretends to be GCC +#if defined(__clang__) + #define COMPILER_CLANG +#elif defined(__GNUC__) + #define COMPILER_GCC +#else + #error "Unknown compiler" +#endif + #endif