X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Falign.h;h=0d4c0150aed189cb7f14bf49308fddc783cf0920;hb=5ce9818ba4e76858b2ef12c81ba75c1306f195d3;hp=a9c88de8ed9e5d9cf47bdbb9b5e4cdb7ed588690;hpb=328342cd737582216dc7b8b7d558b2a1bf8ea5e8;p=babeltrace.git diff --git a/src/common/align.h b/src/common/align.h index a9c88de8..0d4c0150 100644 --- a/src/common/align.h +++ b/src/common/align.h @@ -10,14 +10,14 @@ #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.