source: trunk/align.h @ 36

Last change on this file since 36 was 36, checked in by moo, 8 years ago

fix for fbsd

File size: 445 bytes
RevLine 
[1]1#ifndef __ALIGN_H
2#define __ALIGN_H
[36]3#ifndef ALIGN
[1]4typedef union align_union {
5    double d;
6    void *v;
7    int (*func)(int);
8    long l;
9} align_union;
10
11#if (defined (__GNUC__) && __GNUC__ >= 2)
12#define XCACHE_PLATFORM_ALIGNMENT (__alignof__ (align_union))
13#else
14#define XCACHE_PLATFORM_ALIGNMENT (sizeof(align_union))
15#endif
16
17#define ALIGN(n) ((((size_t)(n)-1) & ~(XCACHE_PLATFORM_ALIGNMENT-1)) + XCACHE_PLATFORM_ALIGNMENT)
[36]18#endif
[1]19#endif /* __ALIGN_H */
Note: See TracBrowser for help on using the repository browser.