defines.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Feeble attempt to document the horde of #defines we deal with.
  2. Editors, please make your descriptions short but informative.
  3. __BEGIN_DECLS, __END_DECLS
  4. Defined to either empty or 'extern "C" {' and '}' if included by C++.
  5. __USE_GNU, __USE_BSD, __USE_XOPEN[2K], __USE_SVID, __USE_POSIX...
  6. If defined, user program which included us requests compat additions
  7. from relevant standard or Unix flavor. See features.h for full list.
  8. _LARGEFILE_SOURCE
  9. If defined, headers will provide functions fseeko and ftello.
  10. _LARGEFILE64_SOURCE
  11. If defined, headers will in addition to data types, constants and
  12. functions named xxx (e.g. off_t, struct stat, F_SETLK, ftruncate())
  13. supply data types, constants and functions named xxx64 (e.g. off64_t,
  14. struct stat64, F_SETLK64, ftruncate64()) known as an interface for
  15. 64-bit file offsets.
  16. __USE_LARGEFILE[64]
  17. Defined to 1 and used internally when built with _LARGEFILE[64]_SOURCE.
  18. Undefined otherwise.
  19. _FILE_OFFSET_BITS
  20. Select default filesystem interface. When defined as 64 the data types,
  21. constants and functions mentioned in _LARGEFILE64_SOURCE as xxx are
  22. aliased to the corresponding xxx64 data types, constants and functions.
  23. _FILE_OFFSET_BITS=64 enables both __USE_LARGEFILE and __USE_LARGEFILE64.
  24. This flag does not affect the way libc itself is built, it only affects
  25. what declarations are provided to library user.
  26. __USE_FILE_OFFSET64
  27. Defined to 1 and used internally when built with _FILE_OFFSET_BITS=64.
  28. Undefined otherwise.
  29. __THROW
  30. Function annotation "I do not throw anything".
  31. __NTH(func(params))
  32. Function annotation "I do not throw anything".
  33. Needed for situatuons when it's unclear on what side of "func(params)"
  34. the "throw()" or "attribute((nothrow))" should eventually appear.
  35. Messy, eh?
  36. return_type __REDIRECT(name, (params), alias)
  37. declare alias to "name(params)"
  38. return_type __REDIRECT_NTH(name, (params), alias)
  39. declare alias to "name(params) __THROW"
  40. __BIG_ENDIAN 4321
  41. __LITTLE_ENDIAN 1234
  42. Should be always as shown. __PDP_ENDIAN is historic, ignore?
  43. __BYTE_ORDER, __FLOAT_WORD_ORDER
  44. Should be defined to __BIG_ENDIAN or __LITTLE_ENDIAN.
  45. Usage: "#if __BYTE_ORDER == __LITTLE_ENDIAN ..."
  46. __USE_BSD adds versions without leading "__" for above four defines.
  47. _BIG_ENDIAN, __BIG_ENDIAN__
  48. _LITTLE_ENDIAN, __LITTLE_ENDIAN__
  49. Defined (to what?) by gcc for some architectures to indicate endianness.
  50. Seems that the fact of defined-ness is an indicator, not the value.
  51. __USE_EXTERN_INLINES
  52. If defined, headers will supply some function as inlines.
  53. uclibc itself is built with this option off and provides
  54. out-of-line version of every inlined function in case user program
  55. calls it instead of using an inline.
  56. _EXTERN_INLINE
  57. If not defined by user prior to #include, will be defined to
  58. "extern inline" or equivalent. IOW, if user defines it prior
  59. #include, it replaces "extern __inline" string in inline definitions
  60. (those enabled by __USE_EXTERN_INLINES) with something else.
  61. A few uclibc .c files use it to create non-inlined functions
  62. by defining it to "".
  63. __extern_inline
  64. Defined to "extern inline", modulo gcc/C standard deviations.
  65. Can't be used by user to play tricks as with _EXTERN_INLINE.
  66. internal_function
  67. Used to modify function's calling convention, if "standard" one
  68. is suboptimal. Examples:
  69. int func(params) internal_function;
  70. int internal_function func(params) { body }
  71. _LIBC
  72. Defined only at libc build time. It is physically deleted
  73. from the headers (using unifdef tool) in installed headers ("make install").
  74. __UCLIBC_XXX
  75. uclibc-internal and uclibc-specific defines. In particular:
  76. __UCLIBC_HAS_XXX__, __UCLIBC_HAVE_XXX__
  77. __UCLIBC_HAS_XXX__ are booleans (defined/undefined), defined in
  78. uClibc_config.h and generated from uclibc .config file.
  79. __UCLIBC_HAVE_XXX__ are booleans from bits/uClibc_arch_features.h
  80. (there are more __UCLIBC_XXX defines there)
  81. __LDBL_COMPAT
  82. Never defined, TODO: remove?
  83. __SSP_ALL__
  84. All functions, even small ones, have stack smashing protection
  85. prologue enabled.