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