defines.txt 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. __USE_FILE_OFFSET64
  9. __USE_LARGEFILE[64]
  10. _LARGEFILE[64]_SOURCE
  11. _FILE_OFFSET_BITS
  12. ???
  13. __THROW
  14. Function annotation "I do not throw anything".
  15. __NTH(func(params))
  16. Function annotation "I do not throw anything".
  17. Needed for situatuons when it's unclear on what side of "func(params)"
  18. the "throw()" or "attribute((nothrow))" should eventually appear.
  19. Messy, eh?
  20. return_type __REDIRECT(name, (params), alias)
  21. declare alias to "name(params)"
  22. return_type __REDIRECT_NTH(name, (params), alias)
  23. declare alias to "name(params) __THROW"
  24. __BIG_ENDIAN 4321
  25. __LITTLE_ENDIAN 1234
  26. Should be always as shown. __PDP_ENDIAN is historic, ignore?
  27. __BYTE_ORDER, __FLOAT_WORD_ORDER
  28. Should be defined to __BIG_ENDIAN or __LITTLE_ENDIAN.
  29. Usage: "#if __BYTE_ORDER == __LITTLE_ENDIAN ..."
  30. __USE_BSD adds versions without leading "__" for above four defines.
  31. _BIG_ENDIAN, __BIG_ENDIAN__
  32. _LITTLE_ENDIAN, __LITTLE_ENDIAN__
  33. Defined (to what?) by gcc for some architectures to indicate endianness.
  34. Seems that the fact of defined-ness is an indicator, not the value.
  35. __USE_EXTERN_INLINES
  36. If defined, headers will supply some function as inlines.
  37. uclibc itself is built with this option off and provides
  38. out-of-line version of every inlined function in case user program
  39. calls it instead of using an inline.
  40. _EXTERN_INLINE
  41. If not defined by user prior to #include, will be defined to
  42. "extern inline" or equivalent. IOW, if user defines it prior
  43. #include, it replaces "extern __inline" string in inline definitions
  44. (those enabled by __USE_EXTERN_INLINES) with something else.
  45. A few uclibc .c files use it to create non-inlined functions
  46. by defining it to "".
  47. __extern_inline
  48. Defined to "extern inline", modulo gcc/C standard deviations.
  49. Can't be used by user to play tricks as with _EXTERN_INLINE.
  50. internal_function
  51. Used to modify function's calling convention, if "standard" one
  52. is suboptimal. Examples:
  53. int func(params) internal_function;
  54. int internal_function func(params) { body }
  55. _LIBC
  56. Defined only at libc build time. It is physically deleted
  57. from the headers (using unifdef tool) in installed headers ("make install").
  58. __UCLIBC_XXX
  59. uclibc-internal and uclibc-specific defines. In particular:
  60. __UCLIBC_HAS_XXX__, __UCLIBC_HAVE_XXX__
  61. __UCLIBC_HAS_XXX__ are booleans (defined/undefined), defined in
  62. uClibc_config.h and generated from uclibc .config file.
  63. __UCLIBC_HAVE_XXX__ are booleans from bits/uClibc_arch_features.h
  64. (there are more __UCLIBC_XXX defines there)
  65. __LDBL_COMPAT
  66. Never defined, TODO: remove?
  67. __SSP_ALL__
  68. All functions, even small ones, have stack smashing protection
  69. prologue enabled.