cdefs.h 946 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef __SYS_CDEFS_H
  2. #define __SYS_CDEFS_H
  3. #include <features.h>
  4. #if defined (__STDC__) && __STDC__
  5. #define __CONCAT(x,y) x ## y
  6. #define __STRING(x) #x
  7. /* This is not a typedef so `const __ptr_t' does the right thing. */
  8. #define __ptr_t void *
  9. #else
  10. #define __CONCAT(x,y) x/**/y
  11. #define __STRING(x) "x"
  12. #define __ptr_t char *
  13. #endif
  14. /* C++ needs to know that types and declarations are C, not C++. */
  15. #ifdef __cplusplus
  16. # define __BEGIN_DECLS extern "C" {
  17. # define __END_DECLS }
  18. #else
  19. # define __BEGIN_DECLS
  20. # define __END_DECLS
  21. #endif
  22. /* GNUish things */
  23. #define __CONSTVALUE
  24. #define __CONSTVALUE2
  25. #ifdef __GNUC__
  26. /* GCC can always grok prototypes. For C++ programs we add throw()
  27. to help it optimize the function calls. But this works only with
  28. gcc 2.8.x and egcs. */
  29. #if defined __cplusplus && __GNUC_PREREQ (2,8)
  30. #define __THROW throw()
  31. #else
  32. #define __THROW
  33. #endif
  34. #else /* GCC */
  35. #define __THROW
  36. #endif
  37. #endif