| 1 | /* Copyright (C) 1991,92,93,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. |
|---|
| 2 | This file is part of the GNU C Library. |
|---|
| 3 | |
|---|
| 4 | The GNU C Library is free software; you can redistribute it and/or |
|---|
| 5 | modify it under the terms of the GNU Lesser General Public |
|---|
| 6 | License as published by the Free Software Foundation; either |
|---|
| 7 | version 2.1 of the License, or (at your option) any later version. |
|---|
| 8 | |
|---|
| 9 | The GNU C Library is distributed in the hope that it will be useful, |
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 12 | Lesser General Public License for more details. |
|---|
| 13 | |
|---|
| 14 | You should have received a copy of the GNU Lesser General Public |
|---|
| 15 | License along with the GNU C Library; if not, write to the Free |
|---|
| 16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
|---|
| 17 | 02111-1307 USA. */ |
|---|
| 18 | |
|---|
| 19 | #ifndef _FEATURES_H |
|---|
| 20 | #define _FEATURES_H 1 |
|---|
| 21 | |
|---|
| 22 | /* For uClibc, always optimize for size -- this should disable |
|---|
| 23 | * a lot of expensive inlining... */ |
|---|
| 24 | #define __OPTIMIZE_SIZE__ 1 |
|---|
| 25 | |
|---|
| 26 | /* These are defined by the user (or the compiler) |
|---|
| 27 | to specify the desired environment: |
|---|
| 28 | |
|---|
| 29 | __STRICT_ANSI__ ISO Standard C. |
|---|
| 30 | _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. |
|---|
| 31 | _POSIX_SOURCE IEEE Std 1003.1. |
|---|
| 32 | _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; |
|---|
| 33 | if >=199309L, add IEEE Std 1003.1b-1993; |
|---|
| 34 | if >=199506L, add IEEE Std 1003.1c-1995 |
|---|
| 35 | _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if |
|---|
| 36 | Single Unix conformance is wanted, to 600 for the |
|---|
| 37 | upcoming sixth revision. |
|---|
| 38 | _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. |
|---|
| 39 | _LARGEFILE_SOURCE Some more functions for correct standard I/O. |
|---|
| 40 | _LARGEFILE64_SOURCE Additional functionality from LFS for large files. |
|---|
| 41 | _FILE_OFFSET_BITS=N Select default filesystem interface. |
|---|
| 42 | _BSD_SOURCE ISO C, POSIX, and 4.3BSD things. |
|---|
| 43 | _SVID_SOURCE ISO C, POSIX, and SVID things. |
|---|
| 44 | _GNU_SOURCE All of the above, plus GNU extensions. |
|---|
| 45 | _REENTRANT Select additionally reentrant object. |
|---|
| 46 | _THREAD_SAFE Same as _REENTRANT, often used by other systems. |
|---|
| 47 | |
|---|
| 48 | The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__. |
|---|
| 49 | If none of these are defined, the default is to have _SVID_SOURCE, |
|---|
| 50 | _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to |
|---|
| 51 | 199506L. If more than one of these are defined, they accumulate. |
|---|
| 52 | For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE |
|---|
| 53 | together give you ISO C, 1003.1, and 1003.2, but nothing else. |
|---|
| 54 | |
|---|
| 55 | These are defined by this file and are used by the |
|---|
| 56 | header files to decide what to declare or define: |
|---|
| 57 | |
|---|
| 58 | __USE_ISOC99 Define ISO C99 things. |
|---|
| 59 | __USE_POSIX Define IEEE Std 1003.1 things. |
|---|
| 60 | __USE_POSIX2 Define IEEE Std 1003.2 things. |
|---|
| 61 | __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. |
|---|
| 62 | __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. |
|---|
| 63 | __USE_XOPEN Define XPG things. |
|---|
| 64 | __USE_XOPEN_EXTENDED Define X/Open Unix things. |
|---|
| 65 | __USE_UNIX98 Define Single Unix V2 things. |
|---|
| 66 | __USE_XOPEN2K Define XPG6 things. |
|---|
| 67 | __USE_LARGEFILE Define correct standard I/O things. |
|---|
| 68 | __USE_LARGEFILE64 Define LFS things with separate names. |
|---|
| 69 | __USE_FILE_OFFSET64 Define 64bit interface as default. |
|---|
| 70 | __USE_BSD Define 4.3BSD things. |
|---|
| 71 | __USE_SVID Define SVID things. |
|---|
| 72 | __USE_MISC Define things common to BSD and System V Unix. |
|---|
| 73 | __USE_GNU Define GNU extensions. |
|---|
| 74 | __USE_REENTRANT Define reentrant/thread-safe *_r functions. |
|---|
| 75 | __FAVOR_BSD Favor 4.3BSD things in cases of conflict. |
|---|
| 76 | |
|---|
| 77 | The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are |
|---|
| 78 | defined by this file unconditionally. `__GNU_LIBRARY__' is provided |
|---|
| 79 | only for compatibility. All new code should use the other symbols |
|---|
| 80 | to test for features. |
|---|
| 81 | |
|---|
| 82 | All macros listed above as possibly being defined by this file are |
|---|
| 83 | explicitly undefined if they are not explicitly defined. |
|---|
| 84 | Feature-test macros that are not defined by the user or compiler |
|---|
| 85 | but are implied by the other feature-test macros defined (or by the |
|---|
| 86 | lack of any definitions) are defined by the file. */ |
|---|
| 87 | |
|---|
| 88 | /* Undefine everything, so we get a clean slate. */ |
|---|
| 89 | #undef __USE_ISOC99 |
|---|
| 90 | #undef __USE_POSIX |
|---|
| 91 | #undef __USE_POSIX2 |
|---|
| 92 | #undef __USE_POSIX199309 |
|---|
| 93 | #undef __USE_POSIX199506 |
|---|
| 94 | #undef __USE_XOPEN |
|---|
| 95 | #undef __USE_XOPEN_EXTENDED |
|---|
| 96 | #undef __USE_UNIX98 |
|---|
| 97 | #undef __USE_XOPEN2K |
|---|
| 98 | #undef __USE_LARGEFILE |
|---|
| 99 | #undef __USE_LARGEFILE64 |
|---|
| 100 | #undef __USE_FILE_OFFSET64 |
|---|
| 101 | #undef __USE_BSD |
|---|
| 102 | #undef __USE_SVID |
|---|
| 103 | #undef __USE_MISC |
|---|
| 104 | #undef __USE_GNU |
|---|
| 105 | #undef __USE_REENTRANT |
|---|
| 106 | #undef __FAVOR_BSD |
|---|
| 107 | #undef __KERNEL_STRICT_NAMES |
|---|
| 108 | |
|---|
| 109 | /* Suppress kernel-name space pollution unless user expressedly asks |
|---|
| 110 | for it. */ |
|---|
| 111 | #ifndef _LOOSE_KERNEL_NAMES |
|---|
| 112 | # define __KERNEL_STRICT_NAMES |
|---|
| 113 | #endif |
|---|
| 114 | |
|---|
| 115 | /* Always use ISO C things. */ |
|---|
| 116 | #define __USE_ANSI 1 |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | /* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */ |
|---|
| 120 | #if defined _BSD_SOURCE && \ |
|---|
| 121 | !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \ |
|---|
| 122 | defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \ |
|---|
| 123 | defined _GNU_SOURCE || defined _SVID_SOURCE) |
|---|
| 124 | # define __FAVOR_BSD 1 |
|---|
| 125 | #endif |
|---|
| 126 | |
|---|
| 127 | /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ |
|---|
| 128 | #ifdef _GNU_SOURCE |
|---|
| 129 | # undef _ISOC99_SOURCE |
|---|
| 130 | # define _ISOC99_SOURCE 1 |
|---|
| 131 | # undef _POSIX_SOURCE |
|---|
| 132 | # define _POSIX_SOURCE 1 |
|---|
| 133 | # undef _POSIX_C_SOURCE |
|---|
| 134 | # define _POSIX_C_SOURCE 199506L |
|---|
| 135 | # undef _XOPEN_SOURCE |
|---|
| 136 | # define _XOPEN_SOURCE 600 |
|---|
| 137 | # undef _XOPEN_SOURCE_EXTENDED |
|---|
| 138 | # define _XOPEN_SOURCE_EXTENDED 1 |
|---|
| 139 | # undef _LARGEFILE64_SOURCE |
|---|
| 140 | # define _LARGEFILE64_SOURCE 1 |
|---|
| 141 | # undef _BSD_SOURCE |
|---|
| 142 | # define _BSD_SOURCE 1 |
|---|
| 143 | # undef _SVID_SOURCE |
|---|
| 144 | # define _SVID_SOURCE 1 |
|---|
| 145 | #endif |
|---|
| 146 | |
|---|
| 147 | /* If nothing (other than _GNU_SOURCE) is defined, |
|---|
| 148 | define _BSD_SOURCE and _SVID_SOURCE. */ |
|---|
| 149 | #if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \ |
|---|
| 150 | !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \ |
|---|
| 151 | !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \ |
|---|
| 152 | !defined _BSD_SOURCE && !defined _SVID_SOURCE) |
|---|
| 153 | # define _BSD_SOURCE 1 |
|---|
| 154 | # define _SVID_SOURCE 1 |
|---|
| 155 | #endif |
|---|
| 156 | |
|---|
| 157 | /* This is to enable the ISO C99 extension. Also recognize the old macro |
|---|
| 158 | which was used prior to the standard acceptance. This macro will |
|---|
| 159 | eventually go away and the features enabled by default once the ISO C99 |
|---|
| 160 | standard is widely adopted. */ |
|---|
| 161 | #if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \ |
|---|
| 162 | || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) |
|---|
| 163 | # define __USE_ISOC99 1 |
|---|
| 164 | #endif |
|---|
| 165 | |
|---|
| 166 | /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2 |
|---|
| 167 | (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */ |
|---|
| 168 | #if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \ |
|---|
| 169 | !defined _POSIX_C_SOURCE) |
|---|
| 170 | # define _POSIX_SOURCE 1 |
|---|
| 171 | # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 |
|---|
| 172 | # define _POSIX_C_SOURCE 2 |
|---|
| 173 | # else |
|---|
| 174 | # define _POSIX_C_SOURCE 199506L |
|---|
| 175 | # endif |
|---|
| 176 | #endif |
|---|
| 177 | |
|---|
| 178 | #if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE |
|---|
| 179 | # define __USE_POSIX 1 |
|---|
| 180 | #endif |
|---|
| 181 | |
|---|
| 182 | #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE |
|---|
| 183 | # define __USE_POSIX2 1 |
|---|
| 184 | #endif |
|---|
| 185 | |
|---|
| 186 | #if (_POSIX_C_SOURCE - 0) >= 199309L |
|---|
| 187 | # define __USE_POSIX199309 1 |
|---|
| 188 | #endif |
|---|
| 189 | |
|---|
| 190 | #if (_POSIX_C_SOURCE - 0) >= 199506L |
|---|
| 191 | # define __USE_POSIX199506 1 |
|---|
| 192 | #endif |
|---|
| 193 | |
|---|
| 194 | #ifdef _XOPEN_SOURCE |
|---|
| 195 | # define __USE_XOPEN 1 |
|---|
| 196 | # if (_XOPEN_SOURCE - 0) >= 500 |
|---|
| 197 | # define __USE_XOPEN_EXTENDED 1 |
|---|
| 198 | # define __USE_UNIX98 1 |
|---|
| 199 | # undef _LARGEFILE_SOURCE |
|---|
| 200 | # define _LARGEFILE_SOURCE 1 |
|---|
| 201 | # if (_XOPEN_SOURCE - 0) >= 600 |
|---|
| 202 | # define __USE_XOPEN2K 1 |
|---|
| 203 | # undef __USE_ISOC99 |
|---|
| 204 | # define __USE_ISOC99 1 |
|---|
| 205 | # endif |
|---|
| 206 | # else |
|---|
| 207 | # ifdef _XOPEN_SOURCE_EXTENDED |
|---|
| 208 | # define __USE_XOPEN_EXTENDED 1 |
|---|
| 209 | # endif |
|---|
| 210 | # endif |
|---|
| 211 | #endif |
|---|
| 212 | |
|---|
| 213 | #ifdef _LARGEFILE_SOURCE |
|---|
| 214 | # define __USE_LARGEFILE 1 |
|---|
| 215 | #endif |
|---|
| 216 | |
|---|
| 217 | #ifdef _LARGEFILE64_SOURCE |
|---|
| 218 | # define __USE_LARGEFILE64 1 |
|---|
| 219 | #endif |
|---|
| 220 | |
|---|
| 221 | #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 |
|---|
| 222 | # define __USE_FILE_OFFSET64 1 |
|---|
| 223 | #endif |
|---|
| 224 | |
|---|
| 225 | #if defined _BSD_SOURCE || defined _SVID_SOURCE |
|---|
| 226 | # define __USE_MISC 1 |
|---|
| 227 | #endif |
|---|
| 228 | |
|---|
| 229 | #ifdef _BSD_SOURCE |
|---|
| 230 | # define __USE_BSD 1 |
|---|
| 231 | #endif |
|---|
| 232 | |
|---|
| 233 | #ifdef _SVID_SOURCE |
|---|
| 234 | # define __USE_SVID 1 |
|---|
| 235 | #endif |
|---|
| 236 | |
|---|
| 237 | #ifdef _GNU_SOURCE |
|---|
| 238 | # define __USE_GNU 1 |
|---|
| 239 | #endif |
|---|
| 240 | |
|---|
| 241 | #if defined _REENTRANT || defined _THREAD_SAFE |
|---|
| 242 | # define __USE_REENTRANT 1 |
|---|
| 243 | #endif |
|---|
| 244 | |
|---|
| 245 | /* We do support the IEC 559 math functionality, real and complex. */ |
|---|
| 246 | #define __STDC_IEC_559__ 1 |
|---|
| 247 | #define __STDC_IEC_559_COMPLEX__ 1 |
|---|
| 248 | |
|---|
| 249 | /* This macro indicates that the installed library is uClibc. Use |
|---|
| 250 | * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in |
|---|
| 251 | * specific releases. */ |
|---|
| 252 | #define __UCLIBC__ 1 |
|---|
| 253 | |
|---|
| 254 | /* Load up the current set of uClibc supported features along |
|---|
| 255 | * with the current uClibc major and minor version numbers. |
|---|
| 256 | * For uClibc release 0.9.26, these numbers would be: |
|---|
| 257 | * #define __UCLIBC_MAJOR__ 0 |
|---|
| 258 | * #define __UCLIBC_MINOR__ 9 |
|---|
| 259 | * #define __UCLIBC_SUBLEVEL__ 26 |
|---|
| 260 | */ |
|---|
| 261 | #define __need_uClibc_config_h |
|---|
| 262 | #include <bits/uClibc_config.h> |
|---|
| 263 | #undef __need_uClibc_config_h |
|---|
| 264 | |
|---|
| 265 | #ifdef __UCLIBC_HAS_WCHAR__ |
|---|
| 266 | /* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.0. */ |
|---|
| 267 | # define __STDC_ISO_10646__ 200009L |
|---|
| 268 | #endif |
|---|
| 269 | |
|---|
| 270 | /* There is an unwholesomely huge amount of code out there that depends on the |
|---|
| 271 | * presence of GNU libc header files. We have GNU libc header files. So here |
|---|
| 272 | * we commit a horrible sin. At this point, we _lie_ and claim to be GNU libc |
|---|
| 273 | * to make things like /usr/include/linux/socket.h and lots of apps work as |
|---|
| 274 | * their developers intended. This is IMHO, pardonable, since these defines |
|---|
| 275 | * are not really intended to check for the presence of a particular library, |
|---|
| 276 | * but rather are used to define an _interface_. */ |
|---|
| 277 | #if !defined __FORCE_NOGLIBC && (!defined _LIBC || defined __FORCE_GLIBC) |
|---|
| 278 | # define __GNU_LIBRARY__ 6 |
|---|
| 279 | # define __GLIBC__ 2 |
|---|
| 280 | # define __GLIBC_MINOR__ 2 |
|---|
| 281 | #endif |
|---|
| 282 | |
|---|
| 283 | /* Convenience macros to test the versions of glibc and gcc. |
|---|
| 284 | Use them like this: |
|---|
| 285 | #if __GNUC_PREREQ (2,8) |
|---|
| 286 | ... code requiring gcc 2.8 or later ... |
|---|
| 287 | #endif |
|---|
| 288 | Note - they won't work for gcc1 or glibc1, since the _MINOR macros |
|---|
| 289 | were not defined then. */ |
|---|
| 290 | #if defined __GNUC__ && defined __GNUC_MINOR__ |
|---|
| 291 | # define __GNUC_PREREQ(maj, min) \ |
|---|
| 292 | ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) |
|---|
| 293 | #else |
|---|
| 294 | # define __GNUC_PREREQ(maj, min) 0 |
|---|
| 295 | #endif |
|---|
| 296 | |
|---|
| 297 | #define __GLIBC_PREREQ(maj, min) \ |
|---|
| 298 | ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) |
|---|
| 299 | |
|---|
| 300 | /* This is here only because every header file already includes this one. */ |
|---|
| 301 | #ifndef __ASSEMBLER__ |
|---|
| 302 | #ifndef _SYS_CDEFS_H |
|---|
| 303 | # include <sys/cdefs.h> |
|---|
| 304 | #endif |
|---|
| 305 | |
|---|
| 306 | /* If we don't have __REDIRECT, prototypes will be missing if |
|---|
| 307 | __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ |
|---|
| 308 | # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT |
|---|
| 309 | # define __USE_LARGEFILE 1 |
|---|
| 310 | # define __USE_LARGEFILE64 1 |
|---|
| 311 | # endif |
|---|
| 312 | |
|---|
| 313 | #endif /* !ASSEMBLER */ |
|---|
| 314 | |
|---|
| 315 | /* Decide whether we can define 'extern inline' functions in headers. */ |
|---|
| 316 | #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ |
|---|
| 317 | && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ |
|---|
| 318 | # define __USE_EXTERN_INLINES 1 |
|---|
| 319 | #endif |
|---|
| 320 | |
|---|
| 321 | |
|---|
| 322 | /* Make sure users large file options agree with uClibc's configuration. */ |
|---|
| 323 | #ifndef __UCLIBC_HAS_LFS__ |
|---|
| 324 | |
|---|
| 325 | /* If uClibc was built without large file support, output an error if |
|---|
| 326 | * and 64-bit file offsets were requested, output an error. |
|---|
| 327 | * NOTE: This is probably incorrect on a 64-bit arch... */ |
|---|
| 328 | #ifdef __USE_FILE_OFFSET64 |
|---|
| 329 | #error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \ |
|---|
| 330 | uClibc was built without large file support enabled. |
|---|
| 331 | #endif |
|---|
| 332 | |
|---|
| 333 | /* If uClibc was built without large file support and _LARGEFILE64_SOURCE |
|---|
| 334 | * is defined, undefine it. */ |
|---|
| 335 | #if defined(_LARGEFILE64_SOURCE) |
|---|
| 336 | #undef _LARGEFILE64_SOURCE |
|---|
| 337 | #undef __USE_LARGEFILE64 |
|---|
| 338 | #endif |
|---|
| 339 | |
|---|
| 340 | /* If we're actually building uClibc with large file support, |
|---|
| 341 | * define __USE_LARGEFILE64 and __USE_LARGEFILE. */ |
|---|
| 342 | #elif defined(_LIBC) |
|---|
| 343 | #undef _LARGEFILE_SOURCE |
|---|
| 344 | #undef _LARGEFILE64_SOURCE |
|---|
| 345 | #undef _FILE_OFFSET_BITS |
|---|
| 346 | #undef __USE_LARGEFILE |
|---|
| 347 | #undef __USE_LARGEFILE64 |
|---|
| 348 | #undef __USE_FILE_OFFSET64 |
|---|
| 349 | #define _LARGEFILE_SOURCE 1 |
|---|
| 350 | #define _LARGEFILE64_SOURCE 1 |
|---|
| 351 | #define __USE_LARGEFILE 1 |
|---|
| 352 | #define __USE_LARGEFILE64 1 |
|---|
| 353 | #endif |
|---|
| 354 | |
|---|
| 355 | /* Some nice features only work properly with ELF */ |
|---|
| 356 | #if defined _LIBC |
|---|
| 357 | #if defined __HAVE_ELF__ |
|---|
| 358 | /* Define ALIASNAME as a weak alias for NAME. */ |
|---|
| 359 | # define weak_alias(name, aliasname) _weak_alias (name, aliasname) |
|---|
| 360 | # define _weak_alias(name, aliasname) \ |
|---|
| 361 | extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); |
|---|
| 362 | /* Define ALIASNAME as a strong alias for NAME. */ |
|---|
| 363 | # define strong_alias(name, aliasname) _strong_alias(name, aliasname) |
|---|
| 364 | # define _strong_alias(name, aliasname) \ |
|---|
| 365 | extern __typeof (name) aliasname __attribute__ ((alias (#name))); |
|---|
| 366 | /* This comes between the return type and function name in |
|---|
| 367 | * a function definition to make that definition weak. */ |
|---|
| 368 | # define weak_function __attribute__ ((weak)) |
|---|
| 369 | # define weak_const_function __attribute__ ((weak, __const__)) |
|---|
| 370 | /* Tacking on "\n\t#" to the section name makes gcc put it's bogus |
|---|
| 371 | * section attributes on what looks like a comment to the assembler. */ |
|---|
| 372 | # if defined(__cris__) |
|---|
| 373 | # define link_warning(symbol, msg) |
|---|
| 374 | # else |
|---|
| 375 | # define link_warning(symbol, msg) \ |
|---|
| 376 | asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \ |
|---|
| 377 | static const char __evoke_link_warning_##symbol[] \ |
|---|
| 378 | __attribute__ ((unused, section (".gnu.warning." #symbol "\n\t#"))) = msg; |
|---|
| 379 | #endif |
|---|
| 380 | #else /* !defined __HAVE_ELF__ */ |
|---|
| 381 | # define strong_alias(name, aliasname) _strong_alias (name, aliasname) |
|---|
| 382 | # define weak_alias(name, aliasname) _strong_alias (name, aliasname) |
|---|
| 383 | # define _strong_alias(name, aliasname) \ |
|---|
| 384 | __asm__(".global " __C_SYMBOL_PREFIX__ #aliasname "\n" \ |
|---|
| 385 | ".set " __C_SYMBOL_PREFIX__ #aliasname "," __C_SYMBOL_PREFIX__ #name); |
|---|
| 386 | # define link_warning(symbol, msg) \ |
|---|
| 387 | asm (".stabs \"" msg "\",30,0,0,0\n\t" \ |
|---|
| 388 | ".stabs \"" #symbol "\",1,0,0,0\n"); |
|---|
| 389 | #endif |
|---|
| 390 | |
|---|
| 391 | #ifndef weak_function |
|---|
| 392 | /* If we do not have the __attribute__ ((weak)) syntax, there is no way we |
|---|
| 393 | can define functions as weak symbols. The compiler will emit a `.globl' |
|---|
| 394 | directive for the function symbol, and a `.weak' directive in addition |
|---|
| 395 | will produce an error from the assembler. */ |
|---|
| 396 | # define weak_function /* empty */ |
|---|
| 397 | # define weak_const_function /* empty */ |
|---|
| 398 | #endif |
|---|
| 399 | |
|---|
| 400 | /* On some platforms we can make internal function calls (i.e., calls of |
|---|
| 401 | functions not exported) a bit faster by using a different calling |
|---|
| 402 | convention. */ |
|---|
| 403 | #ifndef internal_function |
|---|
| 404 | # define internal_function /* empty */ |
|---|
| 405 | #endif |
|---|
| 406 | |
|---|
| 407 | /* Prepare for the case that `__builtin_expect' is not available. */ |
|---|
| 408 | #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 |
|---|
| 409 | #define __builtin_expect(x, expected_value) (x) |
|---|
| 410 | #endif |
|---|
| 411 | #ifndef likely |
|---|
| 412 | # define likely(x) __builtin_expect((!!(x)),1) |
|---|
| 413 | #endif |
|---|
| 414 | #ifndef unlikely |
|---|
| 415 | # define unlikely(x) __builtin_expect((!!(x)),0) |
|---|
| 416 | #endif |
|---|
| 417 | #ifndef __LINUX_COMPILER_H |
|---|
| 418 | #define __LINUX_COMPILER_H |
|---|
| 419 | #endif |
|---|
| 420 | #ifndef __cast__ |
|---|
| 421 | #define __cast__(_to) |
|---|
| 422 | #endif |
|---|
| 423 | |
|---|
| 424 | /* Arrange to hide uClibc internals */ |
|---|
| 425 | #if __GNUC_PREREQ (3, 3) |
|---|
| 426 | # define attribute_hidden __attribute__ ((visibility ("hidden"))) |
|---|
| 427 | #else |
|---|
| 428 | # define attribute_hidden |
|---|
| 429 | #endif |
|---|
| 430 | |
|---|
| 431 | /* Pull in things like __attribute_used__ */ |
|---|
| 432 | #include <sys/cdefs.h> |
|---|
| 433 | |
|---|
| 434 | /* --- this is added to integrate linuxthreads */ |
|---|
| 435 | #define __USE_UNIX98 1 |
|---|
| 436 | |
|---|
| 437 | #endif /* _LIBC only stuff */ |
|---|
| 438 | |
|---|
| 439 | #ifndef __linux__ |
|---|
| 440 | # define __linux__ 1 |
|---|
| 441 | #endif |
|---|
| 442 | |
|---|
| 443 | /* Disable __user, which shows up in 2.6.x include asm headers |
|---|
| 444 | * that get pulled in by signal.h */ |
|---|
| 445 | #define __user |
|---|
| 446 | |
|---|
| 447 | #endif /* features.h */ |
|---|