cdefs.h

Go to the documentation of this file.
00001 /*-
00002  * © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved. 
00003  * Copyright (c) 1991, 1993
00004  *      The Regents of the University of California.  All rights reserved.
00005  *
00006  * This code is derived from software contributed to Berkeley by
00007  * Berkeley Software Design, Inc.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions
00011  * are met:
00012  * 1. Redistributions of source code must retain the above copyright
00013  *    notice, this list of conditions and the following disclaimer.
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in the
00016  *    documentation and/or other materials provided with the distribution.
00017  * 4. Neither the name of the University nor the names of its contributors
00018  *    may be used to endorse or promote products derived from this software
00019  *    without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00022  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00024  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00025  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00026  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00027  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00028  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00029  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00030  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032 * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
00033  *      @(#)cdefs.h     8.8 (Berkeley) 1/9/95
00034  * $FreeBSD: src/sys/sys/cdefs.h,v 1.88.2.1 2005/10/09 07:48:48 netchild Exp $
00035  */
00036 
00037 #ifndef _SYS_CDEFS_H_
00038 #define _SYS_CDEFS_H_
00039 
00040 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
00041 #define SYMBIAN
00042 #endif
00043 
00044 #ifdef __SYMBIAN32__
00045 #include <_ansi.h>
00046 #endif
00047 
00048 #if defined(__cplusplus)
00049 #define __BEGIN_DECLS   extern "C" {
00050 #define __END_DECLS     }
00051 #else
00052 #define __BEGIN_DECLS
00053 #define __END_DECLS
00054 #endif
00055 
00056 /*
00057  * This code has been put in place to help reduce the addition of
00058  * compiler specific defines in FreeBSD code.  It helps to aid in
00059  * having a compiler-agnostic source tree.
00060  */
00061 
00062 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
00063 
00064 #if __GNUC__ >= 3 || defined(__INTEL_COMPILER)
00065 #define __GNUCLIKE_ASM 3
00066 #define __GNUCLIKE_MATH_BUILTIN_CONSTANTS
00067 #else
00068 #define __GNUCLIKE_ASM 2
00069 #endif
00070 #define __GNUCLIKE___TYPEOF 1
00071 #define __GNUCLIKE___OFFSETOF 1
00072 #define __GNUCLIKE___SECTION 1
00073 
00074 #define __GNUCLIKE_ATTRIBUTE_MODE_DI 1
00075 
00076 #ifndef __INTEL_COMPILER
00077 # define __GNUCLIKE_CTOR_SECTION_HANDLING 1
00078 #endif
00079 
00080 #define __GNUCLIKE_BUILTIN_CONSTANT_P 1
00081 # if defined(__INTEL_COMPILER) && defined(__cplusplus) \
00082     && __INTEL_COMPILER < 800
00083 #  undef __GNUCLIKE_BUILTIN_CONSTANT_P
00084 # endif
00085 
00086 #if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER)
00087 # define __GNUCLIKE_BUILTIN_VARARGS 1
00088 # define __GNUCLIKE_BUILTIN_STDARG 1
00089 # define __GNUCLIKE_BUILTIN_VAALIST 1
00090 #endif
00091 
00092 #if defined(__GNUC__)
00093 # define __GNUC_VA_LIST_COMPATIBILITY 1
00094 #endif
00095 
00096 #ifndef __INTEL_COMPILER
00097 # define __GNUCLIKE_BUILTIN_NEXT_ARG 1
00098 # define __GNUCLIKE_MATH_BUILTIN_RELOPS
00099 #endif
00100 
00101 #define __GNUCLIKE_BUILTIN_MEMCPY 1
00102 
00103 /* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */
00104 #define __CC_SUPPORTS_INLINE 1
00105 #define __CC_SUPPORTS___INLINE 1
00106 #define __CC_SUPPORTS___INLINE__ 1
00107 
00108 #define __CC_SUPPORTS___FUNC__ 1
00109 #define __CC_SUPPORTS_WARNING 1
00110 
00111 #define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */
00112 
00113 #define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1
00114 
00115 /* XXX: sys/dev/mpt/mpilib/mpi_type.h uses it, someone should review it */
00116 #define __CC_INT_IS_32BIT 1
00117 
00118 #endif /* __GNUC__ || __INTEL_COMPILER */
00119 
00120 /*
00121  * Macro to test if we're using a specific version of gcc or later.
00122  */
00123 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
00124 #define __GNUC_PREREQ__(ma, mi) \
00125         (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
00126 #else
00127 #define __GNUC_PREREQ__(ma, mi) 0
00128 #endif
00129 
00130 /*
00131  * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
00132  * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
00133  * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
00134  * mode -- there must be no spaces between its arguments, and for nested
00135  * __CONCAT's, all the __CONCAT's must be at the left.  __CONCAT can also
00136  * concatenate double-quoted strings produced by the __STRING macro, but
00137  * this only works with ANSI C.
00138  *
00139  * __XSTRING is like __STRING, but it expands any macros in its argument
00140  * first.  It is only available with ANSI C.
00141  */
00142 #if defined(__STDC__) || defined(__cplusplus)
00143 #define __P(protos)     protos          /* full-blown ANSI C */
00144 #define __CONCAT1(x,y)  x ## y
00145 #define __CONCAT(x,y)   __CONCAT1(x,y)
00146 #define __STRING(x)     #x              /* stringify without expanding x */
00147 #define __XSTRING(x)    __STRING(x)     /* expand x, then stringify */
00148 
00149 #define __const         const           /* define reserved names to standard */
00150 #define __signed        signed
00151 #define __volatile      volatile
00152 #if defined(__cplusplus)
00153 #define __inline        inline          /* convert to C++ keyword */
00154 #else
00155 #if !(defined(__CC_SUPPORTS___INLINE))
00156 #define __inline                        /* delete GCC keyword */
00157 #endif /* ! __CC_SUPPORTS___INLINE */
00158 #endif /* !__cplusplus */
00159 
00160 #else   /* !(__STDC__ || __cplusplus) */
00161 #define __P(protos)     ()              /* traditional C preprocessor */
00162 #define __CONCAT(x,y)   xy
00163 #define __STRING(x)     "x"
00164 
00165 #if !defined(__CC_SUPPORTS___INLINE)
00166 #define __const                         /* delete pseudo-ANSI C keywords */
00167 #define __inline
00168 #define __signed
00169 #define __volatile
00170 /*
00171  * In non-ANSI C environments, new programs will want ANSI-only C keywords
00172  * deleted from the program and old programs will want them left alone.
00173  * When using a compiler other than gcc, programs using the ANSI C keywords
00174  * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
00175  * When using "gcc -traditional", we assume that this is the intent; if
00176  * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
00177  */
00178 #ifndef NO_ANSI_KEYWORDS
00179 #define const                           /* delete ANSI C keywords */
00180 #define inline
00181 #define signed
00182 #define volatile
00183 #endif  /* !NO_ANSI_KEYWORDS */
00184 #endif  /* !__CC_SUPPORTS___INLINE */
00185 #endif  /* !(__STDC__ || __cplusplus) */
00186 
00187 /*
00188  * Compiler-dependent macros to help declare dead (non-returning) and
00189  * pure (no side effects) functions, and unused variables.  They are
00190  * null except for versions of gcc that are known to support the features
00191  * properly (old versions of gcc-2 supported the dead and pure features
00192  * in a different (wrong) way).  If we do not provide an implementation
00193  * for a given compiler, let the compile fail if it is told to use
00194  * a feature that we cannot live without.
00195  */
00196 #ifdef lint
00197 #define __dead2
00198 #define __pure2
00199 #define __unused
00200 #define __packed
00201 #define __aligned(x)
00202 #define __section(x)
00203 #else
00204 #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
00205 #define __dead2
00206 #define __pure2
00207 #define __unused
00208 #endif
00209 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER)
00210 #define __dead2         __attribute__((__noreturn__))
00211 #define __pure2         __attribute__((__const__))
00212 #define __unused
00213 /* XXX Find out what to do for __packed, __aligned and __section */
00214 #endif
00215 #if __GNUC_PREREQ__(2, 7)
00216 #define __dead2         __attribute__((__noreturn__))
00217 #define __pure2         __attribute__((__const__))
00218 #define __unused        __attribute__((__unused__))
00219 #define __used          __attribute__((__used__))
00220 #define __packed        __attribute__((__packed__))
00221 #define __aligned(x)    __attribute__((__aligned__(x)))
00222 #define __section(x)    __attribute__((__section__(x)))
00223 #endif
00224 #if defined(__INTEL_COMPILER)
00225 #define __dead2         __attribute__((__noreturn__))
00226 #define __pure2         __attribute__((__const__))
00227 #define __unused        __attribute__((__unused__))
00228 #define __used          __attribute__((__used__))
00229 #define __packed        __attribute__((__packed__))
00230 #define __aligned(x)    __attribute__((__aligned__(x)))
00231 #define __section(x)    __attribute__((__section__(x)))
00232 #endif
00233 #endif
00234 
00235 #if __GNUC_PREREQ__(2, 96)
00236 #define __pure          __attribute__((__pure__))
00237 #else
00238 #define __pure
00239 #endif
00240 
00241 #if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
00242 #define __always_inline __attribute__((__always_inline__))
00243 #else
00244 #define __always_inline
00245 #endif
00246 
00247 #if __GNUC_PREREQ__(3, 3)
00248 #define __nonnull(x)    __attribute__((__nonnull__(x)))
00249 #else
00250 #define __nonnull(x)
00251 #endif
00252 
00253 /* XXX: should use `#if __STDC_VERSION__ < 199901'. */
00254 #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
00255 #define __func__        NULL
00256 #endif
00257 
00258 #if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
00259 #ifdef __SYMBIAN32__
00260 #ifndef __LONG_LONG_SUPPORTED
00261 #define __LONG_LONG_SUPPORTED
00262 #endif /* __LONG_LONG_SUPPORTED */
00263 #else
00264 #define __LONG_LONG_SUPPORTED
00265 #endif /* __SYMBIAN32__ */
00266 #endif
00267 
00268 #ifdef __SYMBIAN32__
00269 #if (defined(__ARMCC__) && (__ARMCC_VERSION > 220000) )
00270 #ifndef __LONG_LONG_SUPPORTED
00271 #define __LONG_LONG_SUPPORTED
00272 #endif /* __LONG_LONG_SUPPORTED */
00273 #endif
00274 #endif /*__SYMBIAN32__*/
00275 
00276 /*
00277  * GCC 2.95 provides `__restrict' as an extension to C90 to support the
00278  * C99-specific `restrict' type qualifier.  We happen to use `__restrict' as
00279  * a way to define the `restrict' type qualifier without disturbing older
00280  * software that is unaware of C99 keywords.
00281  */
00282 #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
00283 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901
00284 #define __restrict
00285 #else
00286 #define __restrict      restrict
00287 #endif
00288 #endif
00289 
00290 /*
00291  * GNU C version 2.96 adds explicit branch prediction so that
00292  * the CPU back-end can hint the processor and also so that
00293  * code blocks can be reordered such that the predicted path
00294  * sees a more linear flow, thus improving cache behavior, etc.
00295  *
00296  * The following two macros provide us with a way to utilize this
00297  * compiler feature.  Use __predict_true() if you expect the expression
00298  * to evaluate to true, and __predict_false() if you expect the
00299  * expression to evaluate to false.
00300  *
00301  * A few notes about usage:
00302  *
00303  *      * Generally, __predict_false() error condition checks (unless
00304  *        you have some _strong_ reason to do otherwise, in which case
00305  *        document it), and/or __predict_true() `no-error' condition
00306  *        checks, assuming you want to optimize for the no-error case.
00307  *
00308  *      * Other than that, if you don't know the likelihood of a test
00309  *        succeeding from empirical or other `hard' evidence, don't
00310  *        make predictions.
00311  *
00312  *      * These are meant to be used in places that are run `a lot'.
00313  *        It is wasteful to make predictions in code that is run
00314  *        seldomly (e.g. at subsystem initialization time) as the
00315  *        basic block reordering that this affects can often generate
00316  *        larger code.
00317  */
00318 #if __GNUC_PREREQ__(2, 96)
00319 #define __predict_true(exp)     __builtin_expect((exp), 1)
00320 #define __predict_false(exp)    __builtin_expect((exp), 0)
00321 #else
00322 #define __predict_true(exp)     (exp)
00323 #define __predict_false(exp)    (exp)
00324 #endif
00325 
00326 /*
00327  * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
00328  * require it.
00329  */
00330 #ifndef __cplusplus
00331 #define __offsetof(type, field) ((size_t)(&((type *)0)->field))
00332 #else
00333 #define __offsetof(type, field)                                 \
00334   (__offsetof__ (reinterpret_cast <size_t>                      \
00335                  (&reinterpret_cast <const volatile char &>     \
00336                   (static_cast<type *> (0)->field))))
00337 #endif
00338 #define __rangeof(type, start, end) \
00339         (__offsetof(type, end) - __offsetof(type, start))
00340 
00341 /*
00342  * Compiler-dependent macros to declare that functions take printf-like
00343  * or scanf-like arguments.  They are null except for versions of gcc
00344  * that are known to support the features properly (old versions of gcc-2
00345  * didn't permit keeping the keywords out of the application namespace).
00346  */
00347 #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
00348 #define __printflike(fmtarg, firstvararg)
00349 #define __scanflike(fmtarg, firstvararg)
00350 #else
00351 #define __printflike(fmtarg, firstvararg) \
00352             __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
00353 #define __scanflike(fmtarg, firstvararg) \
00354             __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
00355 #endif
00356 
00357 /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
00358 #if __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER)
00359 #define __printf0like(fmtarg, firstvararg) \
00360             __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
00361 #else
00362 #define __printf0like(fmtarg, firstvararg)
00363 #endif
00364 
00365 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
00366 #ifndef __INTEL_COMPILER
00367 #define __strong_reference(sym,aliassym)        \
00368         extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
00369 #endif
00370 #ifdef __STDC__
00371 #define __weak_reference(sym,alias)     \
00372         __asm__(".weak " #alias);       \
00373         __asm__(".equ "  #alias ", " #sym)
00374 #define __warn_references(sym,msg)      \
00375         __asm__(".section .gnu.warning." #sym); \
00376         __asm__(".asciz \"" msg "\"");  \
00377         __asm__(".previous")
00378 #else
00379 #define __weak_reference(sym,alias)     \
00380         __asm__(".weak alias");         \
00381         __asm__(".equ alias, sym")
00382 #define __warn_references(sym,msg)      \
00383         __asm__(".section .gnu.warning.sym"); \
00384         __asm__(".asciz \"msg\"");      \
00385         __asm__(".previous")
00386 #endif  /* __STDC__ */
00387 #endif  /* __GNUC__ || __INTEL_COMPILER */
00388 
00389 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
00390 #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
00391 #else
00392 /*
00393  * The following definition might not work well if used in header files,
00394  * but it should be better than nothing.  If you want a "do nothing"
00395  * version, then it should generate some harmless declaration, such as:
00396  *    #define __IDSTRING(name,string)   struct __hack
00397  */
00398 #define __IDSTRING(name,string) static const char name[] __unused = string
00399 #endif
00400 
00401 /*
00402  * Embed the rcs id of a source file in the resulting library.  Note that in
00403  * more recent ELF binutils, we use .ident allowing the ID to be stripped.
00404  * Usage:
00405  *      __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.88.2.1 2005/10/09 07:48:48 netchild Exp $");
00406  */
00407 #ifndef __FBSDID
00408 #if !defined(lint) && !defined(STRIP_FBSDID)
00409 #define __FBSDID(s)     __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
00410 #else
00411 #define __FBSDID(s)     struct __hack
00412 #endif
00413 #endif
00414 
00415 #ifndef __RCSID
00416 #ifndef NO__RCSID
00417 #define __RCSID(s)      __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
00418 #else
00419 #define __RCSID(s)      struct __hack
00420 #endif
00421 #endif
00422 
00423 #ifndef __RCSID_SOURCE
00424 #ifndef NO__RCSID_SOURCE
00425 #define __RCSID_SOURCE(s)       __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
00426 #else
00427 #define __RCSID_SOURCE(s)       struct __hack
00428 #endif
00429 #endif
00430 
00431 #ifndef __SCCSID
00432 #ifndef NO__SCCSID
00433 #define __SCCSID(s)     __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
00434 #else
00435 #define __SCCSID(s)     struct __hack
00436 #endif
00437 #endif
00438 
00439 #ifndef __COPYRIGHT
00440 #ifndef NO__COPYRIGHT
00441 #define __COPYRIGHT(s)  __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
00442 #else
00443 #define __COPYRIGHT(s)  struct __hack
00444 #endif
00445 #endif
00446 
00447 #ifndef __DECONST
00448 #define __DECONST(type, var)    ((type)(uintptr_t)(const void *)(var))
00449 #endif
00450 
00451 #ifndef __DEVOLATILE
00452 #define __DEVOLATILE(type, var) ((type)(uintptr_t)(volatile void *)(var))
00453 #endif
00454 
00455 #ifndef __DEQUALIFY
00456 #define __DEQUALIFY(type, var)  ((type)(uintptr_t)(const volatile void *)(var))
00457 #endif
00458 
00459 /*-
00460  * The following definitions are an extension of the behavior originally
00461  * implemented in <sys/_posix.h>, but with a different level of granularity.
00462  * POSIX.1 requires that the macros we test be defined before any standard
00463  * header file is included.
00464  *
00465  * Here's a quick run-down of the versions:
00466  *  defined(_POSIX_SOURCE)              1003.1-1988
00467  *  _POSIX_C_SOURCE == 1                1003.1-1990
00468  *  _POSIX_C_SOURCE == 2                1003.2-1992 C Language Binding Option
00469  *  _POSIX_C_SOURCE == 199309           1003.1b-1993
00470  *  _POSIX_C_SOURCE == 199506           1003.1c-1995, 1003.1i-1995,
00471  *                                      and the omnibus ISO/IEC 9945-1: 1996
00472  *  _POSIX_C_SOURCE == 200112           1003.1-2001
00473  *
00474  * In addition, the X/Open Portability Guide, which is now the Single UNIX
00475  * Specification, defines a feature-test macro which indicates the version of
00476  * that specification, and which subsumes _POSIX_C_SOURCE.
00477  *
00478  * Our macros begin with two underscores to avoid namespace screwage.
00479  */
00480 
00481 /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
00482 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
00483 #undef _POSIX_C_SOURCE          /* Probably illegal, but beyond caring now. */
00484 #define _POSIX_C_SOURCE         199009
00485 #endif
00486 
00487 /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
00488 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
00489 #undef _POSIX_C_SOURCE
00490 #define _POSIX_C_SOURCE         199209
00491 #endif
00492 
00493 /* Deal with various X/Open Portability Guides and Single UNIX Spec. */
00494 #ifdef _XOPEN_SOURCE
00495 #if _XOPEN_SOURCE - 0 >= 600
00496 #define __XSI_VISIBLE           600
00497 #undef _POSIX_C_SOURCE
00498 #define _POSIX_C_SOURCE         200112
00499 #elif _XOPEN_SOURCE - 0 >= 500
00500 #define __XSI_VISIBLE           500
00501 #undef _POSIX_C_SOURCE
00502 #define _POSIX_C_SOURCE         199506
00503 #endif
00504 #endif
00505 
00506 /*
00507  * Deal with all versions of POSIX.  The ordering relative to the tests above is
00508  * important.
00509  */
00510 #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
00511 #define _POSIX_C_SOURCE         198808
00512 #endif
00513 #ifdef _POSIX_C_SOURCE
00514 #if _POSIX_C_SOURCE >= 200112
00515 #ifdef __SYMBIAN32__
00516 #define __XSI_VISIBLE           600
00517 #define __BSD_VISIBLE           1
00518 //__SYMBIAN32__
00519 #endif
00520 #define __POSIX_VISIBLE         200112
00521 #define __ISO_C_VISIBLE         1999
00522 #elif _POSIX_C_SOURCE >= 199506
00523 #define __POSIX_VISIBLE         199506
00524 #define __ISO_C_VISIBLE         1990
00525 #elif _POSIX_C_SOURCE >= 199309
00526 #define __POSIX_VISIBLE         199309
00527 #define __ISO_C_VISIBLE         1990
00528 #elif _POSIX_C_SOURCE >= 199209
00529 #define __POSIX_VISIBLE         199209
00530 #define __ISO_C_VISIBLE         1990
00531 #elif _POSIX_C_SOURCE >= 199009
00532 #define __POSIX_VISIBLE         199009
00533 #define __ISO_C_VISIBLE         1990
00534 #else
00535 #define __POSIX_VISIBLE         198808
00536 #define __ISO_C_VISIBLE         0
00537 #endif /* _POSIX_C_SOURCE */
00538 #else
00539 /*-
00540  * Deal with _ANSI_SOURCE:
00541  * If it is defined, and no other compilation environment is explicitly
00542  * requested, then define our internal feature-test macros to zero.  This
00543  * makes no difference to the preprocessor (undefined symbols in preprocessing
00544  * expressions are defined to have value zero), but makes it more convenient for
00545  * a test program to print out the values.
00546  *
00547  * If a program mistakenly defines _ANSI_SOURCE and some other macro such as
00548  * _POSIX_C_SOURCE, we will assume that it wants the broader compilation
00549  * environment (and in fact we will never get here).
00550  */
00551 #if defined(_ANSI_SOURCE)       /* Hide almost everything. */
00552 #define __POSIX_VISIBLE         0
00553 #define __XSI_VISIBLE           0
00554 #define __BSD_VISIBLE           0
00555 #define __ISO_C_VISIBLE         1990
00556 #elif defined(_C99_SOURCE)      /* Localism to specify strict C99 env. */
00557 #define __POSIX_VISIBLE         0
00558 #define __XSI_VISIBLE           0
00559 #define __BSD_VISIBLE           0
00560 #define __ISO_C_VISIBLE         1999
00561 #else                           /* Default environment: show everything. */
00562 #define __POSIX_VISIBLE         200112
00563 #define __XSI_VISIBLE           600
00564 #define __BSD_VISIBLE           1
00565 #define __ISO_C_VISIBLE         1999
00566 #endif
00567 #endif
00568 
00569 #endif /* !_SYS_CDEFS_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top