From: Douglas Gregor Date: Mon, 16 Nov 2009 16:56:48 +0000 (+0000) Subject: Make ERROR_IF_USED macro work with GCC <= 4.2, Apple GCCs X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=1546b11140e0b439856f363c37285e0608394f18;p=oota-llvm.git 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 --- diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index cce652f9261..5c414f8d561 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