features.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. /* Convenience macro to test the version of gcc.
  25. * Use it like this:
  26. * #if __GNUC_PREREQ (2,8)
  27. * ... code requiring gcc 2.8 or later ...
  28. * #endif
  29. * Note - they won't work for gcc1, since the _MINOR macros
  30. * were not defined then. */
  31. #if defined __GNUC__ && defined __GNUC_MINOR__
  32. #define __GNUC_PREREQ(maj, min) \
  33. ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
  34. #else
  35. #define __GNUC_PREREQ(maj,min) 0
  36. #endif
  37. /* __restrict is known in EGCS 1.2 and above. */
  38. #if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 92)
  39. # define __restrict /* Ignore */
  40. #endif
  41. #ifdef __STDC__
  42. #define __P(x) x
  43. #define __PMT(x) x
  44. #ifndef __const
  45. #define __const const
  46. #endif
  47. /* Almost ansi */
  48. #if __STDC__ != 1
  49. #ifndef const
  50. #define const
  51. #endif
  52. #define volatile
  53. #endif
  54. #else /* K&R */
  55. #define __P(x) ()
  56. #ifndef __const
  57. #define __const
  58. #endif
  59. #ifndef const
  60. #define const
  61. #endif
  62. #define volatile
  63. #endif
  64. /* No C++ */
  65. #define __BEGIN_DECLS
  66. #define __END_DECLS
  67. /* GNUish things */
  68. #define __CONSTVALUE
  69. #define __CONSTVALUE2
  70. #define __USE_BSD
  71. #define __USE_MISC
  72. #define __USE_POSIX
  73. #define __USE_POSIX2
  74. #define __USE_XOPEN
  75. #undef __KERNEL_STRICT_NAMES
  76. #ifndef _LOOSE_KERNEL_NAMES
  77. # define __KERNEL_STRICT_NAMES
  78. #endif
  79. #ifdef _GNU_SOURCE
  80. # define __USE_GNU 1
  81. #endif
  82. #include <sys/cdefs.h>
  83. #define __need_uClibc_config_h
  84. #include <bits/uClibc_config.h>
  85. #undef __need_uClibc_config_h
  86. #if 1 /* This only works with GNU ld, but that is what we use 'round these parts */
  87. #define link_warning(symbol, msg) \
  88. asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \
  89. static const char __evoke_link_warning_##symbol[] \
  90. __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
  91. #else
  92. # define link_warning(symbol, msg)
  93. #endif
  94. #endif