From cd5902f976e1f86e360c0c46a0a5793560f9c9c8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 21 Oct 2014 08:07:33 -0600 Subject: [PATCH] compiler: improve gcc 4.x compile time check Signed-off-by: Jens Axboe --- compiler/compiler-gcc4.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/compiler-gcc4.h b/compiler/compiler-gcc4.h index f136611d..e8701cf0 100644 --- a/compiler/compiler-gcc4.h +++ b/compiler/compiler-gcc4.h @@ -5,4 +5,13 @@ #define __must_check __attribute__((warn_unused_result)) #endif +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + +#if GCC_VERSION >= 40300 +#define __compiletime_warning(message) __attribute__((warning(message))) +#define __compiletime_error(message) __attribute__((error(message))) +#endif + #endif -- 2.25.1