Changeset 1617 for trunk/src/emx/include/sys/cdefs.h
- Timestamp:
- Nov 7, 2004, 10:33:03 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/sys/cdefs.h
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r1616 r1617 14 14 * notice, this list of conditions and the following disclaimer in the 15 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software17 * must display the following acknowledgement:18 * This product includes software developed by the University of19 * California, Berkeley and its contributors.20 16 * 4. Neither the name of the University nor the names of its contributors 21 17 * may be used to endorse or promote products derived from this software … … 35 31 * 36 32 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 37 * $FreeBSD: src/sys/sys/cdefs.h,v 1. 69 2003/04/18 18:59:34 bdeExp $33 * $FreeBSD: src/sys/sys/cdefs.h,v 1.81 2004/04/07 04:19:49 imp Exp $ 38 34 */ 39 35 40 36 /** @file 41 * FreeBSD 5. 137 * FreeBSD 5.2 42 38 * 43 39 * @changed bird: Toolkit compatibility (_CDEFS_H_ and __TCPROTO()). … … 58 54 #define __BEGIN_DECLS 59 55 #define __END_DECLS 56 #endif 57 58 /* 59 * Macro to test if we're using a specific version of gcc or later. 60 */ 61 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) 62 #define __GNUC_PREREQ__(ma, mi) \ 63 (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) 64 #else 65 #define __GNUC_PREREQ__(ma, mi) 0 60 66 #endif 61 67 … … 85 91 #define __inline inline /* convert to C++ keyword */ 86 92 #else 87 #if ndef __GNUC__93 #if !(defined(__GNUC__) || defined(__INTEL_COMPILER)) 88 94 #define __inline /* delete GCC keyword */ 89 #endif /* ! __GNUC__*/95 #endif /* !(__GNUC__ || __INTEL_COMPILER) */ 90 96 #endif /* !__cplusplus */ 91 97 … … 95 101 #define __STRING(x) "x" 96 102 97 #if ndef __GNUC__103 #if !(defined(__GNUC__) || defined(__INTEL_COMPILER)) 98 104 #define __const /* delete pseudo-ANSI C keywords */ 99 105 #define __inline … … 114 120 #define volatile 115 121 #endif /* !NO_ANSI_KEYWORDS */ 116 #endif /* ! __GNUC__*/122 #endif /* !(__GNUC__ || __INTEL_COMPILER) */ 117 123 #endif /* !(__STDC__ || __cplusplus) */ 118 124 … … 134 140 #define __section(x) 135 141 #else 136 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5142 #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) 137 143 #define __dead2 138 144 #define __pure2 139 145 #define __unused 140 146 #endif 141 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 147 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) 142 148 #define __dead2 __attribute__((__noreturn__)) 143 149 #define __pure2 __attribute__((__const__)) … … 145 151 /* XXX Find out what to do for __packed, __aligned and __section */ 146 152 #endif 147 #if __GNUC_ _ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ == 3153 #if __GNUC_PREREQ__(2, 7) 148 154 #define __dead2 __attribute__((__noreturn__)) 149 155 #define __pure2 __attribute__((__const__)) … … 153 159 #define __section(x) __attribute__((__section__(x))) 154 160 #endif 161 #if defined(__INTEL_COMPILER) 162 #define __dead2 __attribute__((__noreturn__)) 163 #define __pure2 __attribute__((__const__)) 164 #define __unused __attribute__((__unused__)) 165 #define __packed __attribute__((__packed__)) 166 #define __aligned(x) __attribute__((__aligned__(x))) 167 #define __section(x) __attribute__((__section__(x))) 168 #endif 169 #endif 170 171 #if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) 172 #define __always_inline __attribute__((__always_inline__)) 173 #else 174 #define __always_inline 175 #endif 176 177 #if __GNUC_PREREQ__(3, 3) 178 #define __nonnull(x) __attribute__((__nonnull__(x))) 179 #else 180 #define __nonnull(x) 155 181 #endif 156 182 157 183 /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ 158 #if ! (__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3)184 #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) 159 185 #define __func__ NULL 160 186 #endif 161 187 162 #if __GNUC__ >= 2&& !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901188 #if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 163 189 #define __LONG_LONG_SUPPORTED 164 190 #endif … … 171 197 */ 172 198 #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) 173 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 /* bird: check if not defined. (-pedantic) */199 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 174 200 #define __restrict 175 201 #else 176 202 #define __restrict restrict 177 203 #endif 204 #endif 205 206 /* 207 * GNU C version 2.96 adds explicit branch prediction so that 208 * the CPU back-end can hint the processor and also so that 209 * code blocks can be reordered such that the predicted path 210 * sees a more linear flow, thus improving cache behavior, etc. 211 * 212 * The following two macros provide us with a way to utilize this 213 * compiler feature. Use __predict_true() if you expect the expression 214 * to evaluate to true, and __predict_false() if you expect the 215 * expression to evaluate to false. 216 * 217 * A few notes about usage: 218 * 219 * * Generally, __predict_false() error condition checks (unless 220 * you have some _strong_ reason to do otherwise, in which case 221 * document it), and/or __predict_true() `no-error' condition 222 * checks, assuming you want to optimize for the no-error case. 223 * 224 * * Other than that, if you don't know the likelihood of a test 225 * succeeding from empirical or other `hard' evidence, don't 226 * make predictions. 227 * 228 * * These are meant to be used in places that are run `a lot'. 229 * It is wasteful to make predictions in code that is run 230 * seldomly (e.g. at subsystem initialization time) as the 231 * basic block reordering that this affects can often generate 232 * larger code. 233 */ 234 #if __GNUC_PREREQ__(2, 96) 235 #define __predict_true(exp) __builtin_expect((exp), 1) 236 #define __predict_false(exp) __builtin_expect((exp), 0) 237 #else 238 #define __predict_true(exp) (exp) 239 #define __predict_false(exp) (exp) 178 240 #endif 179 241 … … 190 252 * didn't permit keeping the keywords out of the application namespace). 191 253 */ 192 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 7254 #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) 193 255 #define __printflike(fmtarg, firstvararg) 194 256 #define __scanflike(fmtarg, firstvararg) … … 201 263 202 264 /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ 203 #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 /* bird: check if defined to avoid -Wundef messages */265 #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER) /* bird: check if defined to avoid -Wundef messages */ 204 266 #define __printf0like(fmtarg, firstvararg) \ 205 267 __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) … … 208 270 #endif 209 271 210 #if 0 /* def __GNUC__ - bird: ELF specific, so skip everything */ 272 #if 0 /* defined(__GNUC__) || defined(__INTEL_COMPILER) - bird: ELF specific, so skip everything */ 273 #ifndef __INTEL_COMPILER 211 274 #define __strong_reference(sym,aliassym) \ 212 275 extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); 276 #endif 213 277 #ifdef __STDC__ 214 278 #define __weak_reference(sym,alias) \ … … 228 292 __asm__(".previous") 229 293 #endif /* __STDC__ */ 230 #endif /* __GNUC__ */231 232 #if 0 /* def __GNUC__- ELF specific. */294 #endif /* __GNUC__ || __INTEL_COMPILER */ 295 296 #if 0 /* defined(__GNUC__) || defined(__INTEL_COMPILER) - ELF specific. */ 233 297 #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") 234 298 #else 235 299 /* 236 * This doesn't work in header files. But it may be better than nothing. 237 * The alternative is: #define __IDSTRING(name,string) [nothing] 300 * The following definition might not work well if used in header files, 301 * but it should be better than nothing. If you want a "do nothing" 302 * version, then it should generate some harmless declaration, such as: 303 * #define __IDSTRING(name,string) struct __hack 238 304 */ 239 305 #define __IDSTRING(name,string) static const char name[] __unused = string … … 244 310 * more recent ELF binutils, we use .ident allowing the ID to be stripped. 245 311 * Usage: 246 * __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1. 69 2003/04/18 18:59:34 bdeExp $");312 * __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.81 2004/04/07 04:19:49 imp Exp $"); 247 313 */ 248 314 #ifndef __FBSDID … … 258 324 #define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) 259 325 #else 260 #define __RCSID(s) 326 #define __RCSID(s) struct __hack 261 327 #endif 262 328 #endif … … 266 332 #define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s) 267 333 #else 268 #define __RCSID_SOURCE(s) 334 #define __RCSID_SOURCE(s) struct __hack 269 335 #endif 270 336 #endif … … 274 340 #define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s) 275 341 #else 276 #define __SCCSID(s) 342 #define __SCCSID(s) struct __hack 277 343 #endif 278 344 #endif … … 282 348 #define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s) 283 349 #else 284 #define __COPYRIGHT(s) 350 #define __COPYRIGHT(s) struct __hack 285 351 #endif 286 352 #endif … … 321 387 322 388 /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ 323 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 /* bird: check if defined to avoid -Wundef message. */389 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 324 390 #undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ 325 391 #define _POSIX_C_SOURCE 199009 … … 327 393 328 394 /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ 329 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 /* bird: check if defined to avoid -Wundef message. */395 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 330 396 #undef _POSIX_C_SOURCE 331 397 #define _POSIX_C_SOURCE 199209 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.