| Jens Axboe | 4fee809 | 2007-03-29 09:33:03 +0200 | [diff] [blame] | 1 | #ifndef FIO_COMPILER_H |
| 2 | #define FIO_COMPILER_H | ||||
| 3 | |||||
| 4 | #if __GNUC__ >= 4 | ||||
| 5 | #include "compiler-gcc4.h" | ||||
| Jens Axboe | 73e07ac | 2007-03-29 09:33:46 +0200 | [diff] [blame] | 6 | #elif __GNUC__ == 3 |
| Jens Axboe | 4fee809 | 2007-03-29 09:33:03 +0200 | [diff] [blame] | 7 | #include "compiler-gcc3.h" |
| 8 | #else | ||||
| 9 | #error Compiler too old, need gcc at least gcc 3.x | ||||
| 10 | #endif | ||||
| 11 | |||||
| Jens Axboe | 993cca0 | 2007-03-29 09:35:35 +0200 | [diff] [blame] | 12 | #ifndef __must_check |
| 13 | #define __must_check | ||||
| 14 | #endif | ||||
| 15 | |||||
| Jens Axboe | f3f552b | 2008-06-13 10:27:05 +0200 | [diff] [blame] | 16 | #define uninitialized_var(x) x = x |
| 17 | |||||
| Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 18 | #ifndef __weak |
| Bruce Cran | 9b83656 | 2011-01-08 19:49:54 +0100 | [diff] [blame] | 19 | #ifndef __CYGWIN__ |
| Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 20 | #define __weak __attribute__((weak)) |
| Bruce Cran | 9b83656 | 2011-01-08 19:49:54 +0100 | [diff] [blame] | 21 | #else |
| 22 | #define __weak | ||||
| 23 | #endif | ||||
| Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 24 | #endif |
| Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 25 | |
| Jens Axboe | 4fee809 | 2007-03-29 09:33:03 +0200 | [diff] [blame] | 26 | #endif |