The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/featuretest.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: featuretest.h,v 1.7 2003/12/04 12:42:54 keihan Exp $   */
    2 
    3 /*
    4  * Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.
    5  * Public domain.
    6  *
    7  * NOTE: Do not protect this header against multiple inclusion.  Doing
    8  * so can have subtle side-effects due to header file inclusion order
    9  * and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
   10  * protect each CPP macro that we want to supply.
   11  */
   12 
   13 /*
   14  * Feature-test macros are defined by several standards, and allow an
   15  * application to specify what symbols they want the system headers to
   16  * expose, and hence what standard they want them to conform to.
   17  * There are two classes of feature-test macros.  The first class
   18  * specify complete standards, and if one of these is defined, header
   19  * files will try to conform to the relevant standard.  They are:
   20  *
   21  * ANSI macros:
   22  * _ANSI_SOURCE                 ANSI C89
   23  *
   24  * POSIX macros:
   25  * _POSIX_SOURCE == 1           IEEE Std 1003.1 (version?)
   26  * _POSIX_C_SOURCE == 1         IEEE Std 1003.1-1990
   27  * _POSIX_C_SOURCE == 2         IEEE Std 1003.2-1992
   28  * _POSIX_C_SOURCE == 199309L   IEEE Std 1003.1b-1993
   29  * _POSIX_C_SOURCE == 199506L   ISO/IEC 9945-1:1996
   30  * _POSIX_C_SOURCE == 200112L   IEEE Std 1003.1-2001
   31  *
   32  * X/Open macros:
   33  * _XOPEN_SOURCE                System Interfaces and Headers, Issue 4, Ver 2
   34  * _XOPEN_SOURCE_EXTENDED == 1  XSH4.2 UNIX extensions
   35  * _XOPEN_SOURCE == 500         System Interfaces and Headers, Issue 5
   36  * _XOPEN_SOURCE == 520         Networking Services (XNS), Issue 5.2
   37  * _XOPEN_SOURCE == 600         IEEE Std 1003.1-2001, XSI option
   38  *
   39  * NetBSD macros:
   40  * _NETBSD_SOURCE == 1          Make all NetBSD features available.
   41  *
   42  * If more than one of these "major" feature-test macros is defined,
   43  * then the set of facilities provided (and namespace used) is the
   44  * union of that specified by the relevant standards, and in case of
   45  * conflict, the earlier standard in the above list has precedence (so
   46  * if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version
   47  * of rename() that's used is the POSIX one).  If none of the "major"
   48  * feature-test macros is defined, _NETBSD_SOURCE is assumed.
   49  *
   50  * There are also "minor" feature-test macros, which enable extra
   51  * functionality in addition to some base standard.  They should be
   52  * defined along with one of the "major" macros.  The "minor" macros
   53  * are:
   54  *
   55  * _REENTRANT
   56  * _ISOC99_SOURCE
   57  * _LARGEFILE_SOURCE            Large File Support
   58  *              <http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>
   59  */
   60 
   61 #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
   62 #define _POSIX_C_SOURCE 1L
   63 #endif
   64 
   65 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
   66     !defined(_XOPEN_SOURCE) && !defined(_NETBSD_SOURCE)
   67 #define _NETBSD_SOURCE 1
   68 #endif
   69 
   70 #if ((_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500) && \
   71     !defined(_REENTRANT)
   72 #define _REENTRANT
   73 #endif

Cache object: 8d8a1c52f5abbd3a238a9d8bd5b951e6


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.