1 #ifndef __OT_LAYOUT_CONFIG_H__ 2 #define __OT_LAYOUT_CONFIG_H__ 3 4 /************************************************************************/ 5 /************************************************************************/ 6 /***** *****/ 7 /***** CONFIGURATION MACROS *****/ 8 /***** *****/ 9 /************************************************************************/ 10 /************************************************************************/ 11 12 #ifdef __cplusplus 13 # define OTL_BEGIN_HEADER extern "C" { 14 #else 15 # define OTL_BEGIN_HEADER /* nothing */ 16 #endif 17 18 #ifdef __cplusplus 19 # define OTL_END_HEADER } 20 #else 21 # define OTL_END_HEADER /* nothing */ 22 #endif 23 24 #ifndef OTL_API 25 # ifdef __cplusplus 26 # define OTL_API( x ) extern "C" 27 # else 28 # define OTL_API( x ) extern x 29 # endif 30 #endif 31 32 #ifndef OTL_APIDEF 33 # define OTL_APIDEF( x ) x 34 #endif 35 36 #ifndef OTL_LOCAL 37 # define OTL_LOCAL( x ) extern x 38 #endif 39 40 #ifndef OTL_LOCALDEF 41 # define OTL_LOCALDEF( x ) x 42 #endif 43 44 #define OTL_BEGIN_STMNT do { 45 #define OTL_END_STMNT } while (0) 46 #define OTL_DUMMY_STMNT OTL_BEGIN_STMNT OTL_END_STMNT 47 48 #define OTL_UNUSED( x ) (x)=(x) 49 #define OTL_UNUSED_CONST(x) (void)(x) 50 51 52 #include <limits.h> 53 #if UINT_MAX == 0xFFFFU 54 # define OTL_SIZEOF_INT 2 55 #elif UINT_MAX == 0xFFFFFFFFU 56 # define OTL_SIZEOF_INT 4 57 #elif UINT_MAX > 0xFFFFFFFFU && UINT_MAX == 0xFFFFFFFFFFFFFFFFU 58 # define OTL_SIZEOF_INT 8 59 #else 60 # error "unsupported number of bytes in 'int' type!" 61 #endif 62 63 #if ULONG_MAX == 0xFFFFFFFFU 64 # define OTL_SIZEOF_LONG 4 65 #elif ULONG_MAX > 0xFFFFFFFFU && ULONG_MAX == 0xFFFFFFFFFFFFFFFFU 66 # define OTL_SIZEOF_LONG 8 67 #else 68 # error "unsupported number of bytes in 'long' type!" 69 #endif 70 71 #include <setjmp.h> 72 #define OTL_jmp_buf jmp_buf 73 #define otl_setjmp setjmp 74 #define otl_longjmp longjmp 75 76 /* */ 77 78 #endif /* __OT_LAYOUT_CONFIG_H__ */ 79