Merge branch 'master' into expression-parser
authorJens Axboe <axboe@fb.com>
Mon, 29 Sep 2014 22:29:32 +0000 (16:29 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 29 Sep 2014 22:29:32 +0000 (16:29 -0600)
os/os-linux.h

index 81d04027efb9491fde44c783922dc368734d5042..e1936342bd54fceac5b61d765a86adfacfdcf970 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/unistd.h>
 #include <linux/raw.h>
 #include <linux/major.h>
+#include <byteswap.h>
 
 #include "binject.h"
 #include "../file.h"
@@ -208,9 +209,21 @@ static inline int fio_lookup_raw(dev_t dev, int *majdev, int *mindev)
 #define FIO_MADV_FREE  MADV_REMOVE
 #endif
 
+#if defined(__builtin_bswap16)
+#define fio_swap16(x)  __builtin_bswap16(x)
+#else
 #define fio_swap16(x)  __bswap_16(x)
+#endif
+#if defined(__builtin_bswap32)
+#define fio_swap32(x)  __builtin_bswap32(x)
+#else
 #define fio_swap32(x)  __bswap_32(x)
+#endif
+#if defined(__builtin_bswap64)
+#define fio_swap64(x)  __builtin_bswap64(x)
+#else
 #define fio_swap64(x)  __bswap_64(x)
+#endif
 
 #define CACHE_LINE_FILE        \
        "/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"