features.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #ifndef __FEATURES_H
  2. #define __FEATURES_H
  3. /* Major and minor version number of the uClibc library package. Use
  4. these macros to test for features in specific releases. */
  5. #define __UCLIBC__ 0
  6. #define __UCLIBC_MAJOR__ 9
  7. #define __UCLIBC_MINOR__ 5
  8. /* There is an unwholesomely huge amount of code out there that depends on the
  9. * presence of GNU libc header files. We have GNU libc header files. So here
  10. * we commit a horrible sin. At this point, we _lie_ and claim to be GNU libc
  11. * to make things like /usr/include/linux/socket.h and lots of apps work as
  12. * their developers intended. This is IMHO, pardonable, since these defines
  13. * are not really intended to check for the presence of a particular library,
  14. * but rather are used to define an _interface_. */
  15. #if !defined _LIBC || defined __FORCE_GLIBC__
  16. # define __GNU_LIBRARY__ 6
  17. # define __GLIBC__ 2
  18. # define __GLIBC_MINOR__ 1
  19. #endif
  20. /* Make a half-hearted attempt to accomodate non-gcc compilers */
  21. #ifndef __GNUC__
  22. #define __attribute(foo) /* Ignore */
  23. #endif
  24. /* __restrict is known in EGCS 1.2 and above. */
  25. #if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 92)
  26. # define __restrict /* Ignore */
  27. #endif
  28. #ifdef __STDC__
  29. #define __P(x) x
  30. #define __PMT(x) x
  31. #ifndef __const
  32. #define __const const
  33. #endif
  34. /* Almost ansi */
  35. #if __STDC__ != 1
  36. #ifndef const
  37. #define const
  38. #endif
  39. #define volatile
  40. #endif
  41. #else /* K&R */
  42. #define __P(x) ()
  43. #ifndef __const
  44. #define __const
  45. #endif
  46. #ifndef const
  47. #define const
  48. #endif
  49. #define volatile
  50. #endif
  51. /* No C++ */
  52. #define __BEGIN_DECLS
  53. #define __END_DECLS
  54. /* GNUish things */
  55. #define __CONSTVALUE
  56. #define __CONSTVALUE2
  57. #define __USE_BSD
  58. #define __USE_MISC
  59. #define __USE_POSIX
  60. #define __USE_POSIX2
  61. #define __USE_XOPEN
  62. #undef __KERNEL_STRICT_NAMES
  63. #ifndef _LOOSE_KERNEL_NAMES
  64. # define __KERNEL_STRICT_NAMES
  65. #endif
  66. #ifdef _GNU_SOURCE
  67. # define __USE_GNU 1
  68. #endif
  69. #include <sys/cdefs.h>
  70. #define __need_uClibc_config_h
  71. #include <bits/uClibc_config.h>
  72. #undef __need_uClibc_config_h
  73. #if 1 /* This only works with GNU ld, but that is what we use 'round these parts */
  74. #define link_warning(symbol, msg) \
  75. asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \
  76. static const char __evoke_link_warning_##symbol[] \
  77. __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
  78. #else
  79. # define link_warning(symbol, msg)
  80. #endif
  81. #endif