defines.txt 4.1 KB

  1. Feeble attempt to document the horde of #defines we deal with.
  2. Editors, please make your descriptions short but informative.
  4. Defined to either empty or 'extern "C" {' and '}' if included by C++.
  6. If defined, user program which included us requests compat additions
  7. from relevant standard or Unix flavor. See features.h for full list.
  9. If defined, headers will provide functions fseeko and ftello.
  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.
  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.
  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?
  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.
  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.
  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.
  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:
  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)
  82. Never defined, TODO: remove?
  83. __SSP_ALL__
  84. All functions, even small ones, have stack smashing protection
  85. prologue enabled.