]> git.ozlabs.org Git - ccan/commitdiff
Use new alignof package
authorRusty Russell <rusty@vivaldi>
Sun, 18 May 2008 06:20:39 +0000 (16:20 +1000)
committerRusty Russell <rusty@vivaldi>
Sun, 18 May 2008 06:20:39 +0000 (16:20 +1000)
alloc/alloc.c

index cc1b845b550ef61dfba54c045550ea775846ff65..f7a05e2d9f273d64f98aa36d977b80121094f057 100644 (file)
@@ -6,16 +6,11 @@
 #include <stdlib.h>
 #include "alloc.h"
 #include "build_assert/build_assert.h"
+#include "alignof/alignof.h"
 #include "config.h"
 
 /* FIXME: We assume getpagesize() doesnt change.  Remapping file with
  * different pagesize should still work. */
-#if HAVE_ALIGNOF
-#define ALIGNOF(t) __alignof__(t)
-#else
-/* Alignment by measuring structure padding. */
-#define ALIGNOF(t) (sizeof(struct { char c; t _h; }) - 1 - sizeof(t))
-#endif
 
 /* FIXME: Doesn't handle non-page-aligned poolsize. */