root/tags/1.2.2/align.h

Revision 394, 445 bytes (checked in by moo, 19 months ago)

merged [393] from trunk: svn:eol-style

  • Property svn:eol-style set to native
Line 
1#ifndef __ALIGN_H
2#define __ALIGN_H
3#ifndef ALIGN
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)
18#endif
19#endif /* __ALIGN_H */
Note: See TracBrowser for help on using the browser.