Use __typeof__ instead of typeof
[babeltrace.git] / src / common / align.h
index a9c88de8ed9e5d9cf47bdbb9b5e4cdb7ed588690..0d4c0150aed189cb7f14bf49308fddc783cf0920 100644 (file)
 #include "compat/compiler.h"
 #include "compat/limits.h"
 
-#define BT_ALIGN(x, a)         __BT_ALIGN_MASK(x, (typeof(x))(a) - 1)
+#define BT_ALIGN(x, a)         __BT_ALIGN_MASK(x, (__typeof__(x))(a) - 1)
 #define __BT_ALIGN_MASK(x, mask)       (((x) + (mask)) & ~(mask))
-#define BT_PTR_ALIGN(p, a)             ((typeof(p)) BT_ALIGN((unsigned long) (p), a))
-#define BT_ALIGN_FLOOR(x, a)   __BT_ALIGN_FLOOR_MASK(x, (typeof(x)) (a) - 1)
+#define BT_PTR_ALIGN(p, a)             ((__typeof__(p)) BT_ALIGN((unsigned long) (p), a))
+#define BT_ALIGN_FLOOR(x, a)   __BT_ALIGN_FLOOR_MASK(x, (__typeof__(x)) (a) - 1)
 #define __BT_ALIGN_FLOOR_MASK(x, mask) ((x) & ~(mask))
 #define BT_PTR_ALIGN_FLOOR(p, a) \
-                       ((typeof(p)) BT_ALIGN_FLOOR((unsigned long) (p), a))
-#define BT_IS_ALIGNED(x, a)    (((x) & ((typeof(x)) (a) - 1)) == 0)
+                       ((__typeof__(p)) BT_ALIGN_FLOOR((unsigned long) (p), a))
+#define BT_IS_ALIGNED(x, a)    (((x) & ((__typeof__(x)) (a) - 1)) == 0)
 
 /*
  * Align pointer on natural object alignment.
This page took 0.02355 seconds and 4 git commands to generate.