Guard __must_check ifdef
authorJens Axboe <jens.axboe@oracle.com>
Sun, 24 Jun 2007 20:41:27 +0000 (22:41 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Sun, 24 Jun 2007 20:41:27 +0000 (22:41 +0200)
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 <jens.axboe@oracle.com>
compiler/compiler-gcc3.h
compiler/compiler-gcc4.h

index ab8ccc4fdaca7a6a712c89e846ec9c9e02e2d6dd..566987a216641ca75db602fb1353209ba0b833d1 100644 (file)
@@ -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
index bb9cc7c555130676e85d2f9b1550fdebc53e9f3f..f136611dd20d596290d05d50802830d313805d19 100644 (file)
@@ -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