From 72711fb74534e2caa15a1a775ff8d5e531fb8fef Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 24 Jun 2007 22:41:27 +0200 Subject: [PATCH] Guard __must_check ifdef Some systems seem to pick up the kernel definitions, so check if __must_check is defined before (potentially) redefining it. Signed-off-by: Jens Axboe --- compiler/compiler-gcc3.h | 2 ++ compiler/compiler-gcc4.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/compiler/compiler-gcc3.h b/compiler/compiler-gcc3.h index ab8ccc4f..566987a2 100644 --- a/compiler/compiler-gcc3.h +++ b/compiler/compiler-gcc3.h @@ -2,7 +2,9 @@ #define FIO_COMPILER_GCC3_H #if __GNUC_MINOR__ >= 4 +#ifndef __must_check #define __must_check __attribute__((warn_unused_result)) #endif +#endif #endif diff --git a/compiler/compiler-gcc4.h b/compiler/compiler-gcc4.h index bb9cc7c5..f136611d 100644 --- a/compiler/compiler-gcc4.h +++ b/compiler/compiler-gcc4.h @@ -1,6 +1,8 @@ #ifndef FIO_COMPILER_GCC4_H #define FIO_COMPILER_GCC4_H +#ifndef __must_check #define __must_check __attribute__((warn_unused_result)) +#endif #endif -- 2.25.1