Merge branch 'master' of https://github.com/bvanassche/fio
[fio.git] / oslib / libmtd_common.h
index 87f93b61971129ef34eb0a24777a298fdc7f47d8..db0494dda3587247efd97335983ca63e11d5b387 100644 (file)
@@ -47,20 +47,19 @@ extern "C" {
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
 #define min(a, b) MIN(a, b) /* glue for linux kernel source */
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define ALIGN(x,a) __ALIGN_MASK(x,(__typeof__(x))(a)-1)
 #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
 
 #define min_t(t,x,y) ({ \
-       typeof((x)) _x = (x); \
-       typeof((y)) _y = (y); \
+       __typeof__((x)) _x = (x); \
+       __typeof__((y)) _y = (y); \
        (_x < _y) ? _x : _y; \
 })
 
 #define max_t(t,x,y) ({ \
-       typeof((x)) _x = (x); \
-       typeof((y)) _y = (y); \
+       __typeof__((x)) _x = (x); \
+       __typeof__((y)) _y = (y); \
        (_x > _y) ? _x : _y; \
 })