otlconf.h 2.0 KB

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