align.h: support cygwin page size
[lttng-ust.git] / include / lttng / align.h
index 9154051e33e59363cf24ee77a065dd675ab976b6..4b3c1709945735c52497a09d7effa0b382af878b 100644 (file)
 
 #include <lttng/bug.h>
 #include <unistd.h>
+#include <limits.h>
 
+#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)
 
 /**
This page took 0.026252 seconds and 4 git commands to generate.