Pol  Revision:6c772dc
compileassert.h
Go to the documentation of this file.
1 
25 #ifndef CLIB_COMPILEASSERT_H
26 #define CLIB_COMPILEASSERT_H
27 
28 extern char xxxyyyzzz[1];
29 #if _lint
30 #define asserteql( a, b ) extern char xxxyyyzzz[1]
31 #define assertofs( type, var, pos ) extern char xxxyyyzzz[1]
32 #else
33 #define asserteql( a, b ) extern char xxxyyyzzz[(unsigned)1 - (unsigned)( a ^ ( b ) )]
34 #define assertofs( type, var, pos ) asserteql( offsetof( type, var ), pos )
35 #endif
36 #define arsize( a ) ( sizeof a / sizeof a[0] )
37 
38 #define assertsize( type, length ) \
39  extern char size_##type[length]; \
40  extern char size_##type[sizeof( type )]
41 
42 #endif
char xxxyyyzzz[1]