types.h 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /** @file types.h
  2. * @brief Additional usefull data types
  3. */
  4. #ifndef _faux_types_h
  5. #define _faux_types_h
  6. /**
  7. * A standard boolean type. The possible values are
  8. * BOOL_FALSE and BOOL_TRUE.
  9. */
  10. typedef enum {
  11. BOOL_FALSE = 0,
  12. BOOL_TRUE = 1
  13. } bool_t;
  14. /** @def C_DECL_BEGIN
  15. * This macro can be used instead standard preprocessor
  16. * directive like this:
  17. * @code
  18. * #ifdef __cplusplus
  19. * extern "C" {
  20. * #endif
  21. *
  22. * int foobar(void);
  23. *
  24. * #ifdef __cplusplus
  25. * }
  26. * #endif
  27. * @endcode
  28. * It make linker to use C-style linking for functions.
  29. * Use C_DECL_BEGIN before functions declaration and C_DECL_END
  30. * after declaration:
  31. * @code
  32. * C_DECL_BEGIN
  33. *
  34. * int foobar(void);
  35. *
  36. * C_DECL_END
  37. * @endcode
  38. */
  39. /** @def C_DECL_END
  40. * See the macro C_DECL_BEGIN.
  41. * @sa C_DECL_BEGIN
  42. */
  43. #ifdef __cplusplus
  44. #define C_DECL_BEGIN extern "C" {
  45. #define C_DECL_END }
  46. #else
  47. #define C_DECL_BEGIN
  48. #define C_DECL_END
  49. #endif
  50. #endif /* _faux_types_h */