X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Falign.h;h=4b3c1709945735c52497a09d7effa0b382af878b;hb=7bc53e94a229963972aa78880b361b1510fdd268;hp=9154051e33e59363cf24ee77a065dd675ab976b6;hpb=9501d22f55b3a23f382f631c99b2325d1419b5da;p=lttng-ust.git diff --git a/include/lttng/align.h b/include/lttng/align.h index 9154051e..4b3c1709 100644 --- a/include/lttng/align.h +++ b/include/lttng/align.h @@ -19,11 +19,15 @@ #include #include +#include +#ifndef PAGE_SIZE /* Cygwin limits.h defines its own PAGE_SIZE */ #define PAGE_SIZE sysconf(_SC_PAGE_SIZE) +#endif + #define PAGE_MASK (~(PAGE_SIZE - 1)) #define __ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask)) -#define ALIGN(v, align) __ALIGN_MASK(v, (typeof(v)) (align) - 1) +#define ALIGN(v, align) __ALIGN_MASK(v, (__typeof__(v)) (align) - 1) #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) /**