blob: 0a0213b60fca5204cb9d0294ffb01139baa23083 [file] [log] [blame]
Jens Axboe4fee8092007-03-29 09:33:03 +02001#ifndef FIO_COMPILER_H
2#define FIO_COMPILER_H
3
4#if __GNUC__ >= 4
5#include "compiler-gcc4.h"
Jens Axboe73e07ac2007-03-29 09:33:46 +02006#elif __GNUC__ == 3
Jens Axboe4fee8092007-03-29 09:33:03 +02007#include "compiler-gcc3.h"
8#else
9#error Compiler too old, need gcc at least gcc 3.x
10#endif
11
Jens Axboe993cca02007-03-29 09:35:35 +020012#ifndef __must_check
13#define __must_check
14#endif
15
Jens Axboe7b4203d2013-04-17 19:29:37 +020016/*
17 * Mark unused variables passed to ops functions as unused, to silence gcc
18 */
19#define fio_unused __attribute__((__unused__))
20#define fio_init __attribute__((constructor))
21#define fio_exit __attribute__((destructor))
22
Jens Axboe225ba9e2014-02-26 14:31:15 -080023#define fio_unlikely(x) __builtin_expect(!!(x), 0)
24
Jens Axboe4fee8092007-03-29 09:33:03 +020025#endif