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