Make ERROR_IF_USED macro work with GCC <= 4.2, Apple GCCs
authorDouglas Gregor <dgregor@apple.com>
Mon, 16 Nov 2009 16:56:48 +0000 (16:56 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 16 Nov 2009 16:56:48 +0000 (16:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88916 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Compiler.h

index cce652f9261947ece3799db13ebcc349f8ecc04a..5c414f8d5616d38a463049c8a780b53bcd1e2aa1 100644 (file)
 #define NORETURN
 #endif
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && ((__GNUC__ > 4)||(__GNUC__ == 4 && __GNUC_MINOR__ > 2))
 #define ERROR_IF_USED __attribute__((error("wrong usage")))
+#elif defined(__APPLE__)
+#define ERROR_IF_USED __attribute__((unavailable))
 #else
 #define ERROR_IF_USED
 #endif