aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Compiler.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-16 16:56:48 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-16 16:56:48 +0000
commit1546b11140e0b439856f363c37285e0608394f18 (patch)
treee3f7758c8e51a3ec82ed32bbc5aea7c7023aacde /include/llvm/Support/Compiler.h
parent4007324b58db24b0d358445a0a866a9047dac75e (diff)
downloadexternal_llvm-1546b11140e0b439856f363c37285e0608394f18.zip
external_llvm-1546b11140e0b439856f363c37285e0608394f18.tar.gz
external_llvm-1546b11140e0b439856f363c37285e0608394f18.tar.bz2
Make ERROR_IF_USED macro work with GCC <= 4.2, Apple GCCs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compiler.h')
-rw-r--r--include/llvm/Support/Compiler.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index cce652f..5c414f8 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -78,8 +78,10 @@
#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