Back to index

glibc  2.9
environments.h
Go to the documentation of this file.
00001 /* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _UNISTD_H
00020 # error "Never include this file directly.  Use <unistd.h> instead"
00021 #endif
00022 
00023 #include <bits/wordsize.h>
00024 
00025 /* This header should define the following symbols under the described
00026    situations.  A value `1' means that the model is always supported,
00027    `-1' means it is never supported.  Undefined means it cannot be
00028    statically decided.
00029 
00030    _POSIX_V6_ILP32_OFF32   32bit int, long, pointers, and off_t type
00031    _POSIX_V6_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
00032 
00033    _POSIX_V6_LP64_OFF32        64bit long and pointers and 32bit off_t type
00034    _POSIX_V6_LPBIG_OFFBIG  64bit long and pointers and large off_t type
00035 
00036    The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and
00037    _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard
00038    and are available only for compatibility.
00039 */
00040 
00041 #if __WORDSIZE == 64
00042 
00043 /* Environments with 32-bit wide pointers are optionally provided.
00044    Therefore following macros aren't defined:
00045    # undef _POSIX_V6_ILP32_OFF32
00046    # undef _POSIX_V6_ILP32_OFFBIG
00047    # undef _XBS5_ILP32_OFF32
00048    # undef _XBS5_ILP32_OFFBIG
00049    and users need to check at runtime.  */
00050 
00051 /* We also have no use (for now) for an environment with bigger pointers
00052    and offsets.  */
00053 # define _POSIX_V6_LPBIG_OFFBIG    -1
00054 # define _XBS5_LPBIG_OFFBIG -1
00055 
00056 /* By default we have 64-bit wide `long int', pointers and `off_t'.  */
00057 # define _POSIX_V6_LP64_OFF64      1
00058 # define _XBS5_LP64_OFF64   1
00059 
00060 #else /* __WORDSIZE == 32 */
00061 
00062 /* By default we have 32-bit wide `int', `long int', pointers and `off_t'
00063    and all platforms support LFS.  */
00064 # define _POSIX_V6_ILP32_OFF32     1
00065 # define _POSIX_V6_ILP32_OFFBIG    1
00066 # define _XBS5_ILP32_OFF32  1
00067 # define _XBS5_ILP32_OFFBIG 1
00068 
00069 /* We optionally provide an environment with the above size but an 64-bit
00070    side `off_t'.  Therefore we don't define _XBS5_ILP32_OFFBIG.  */
00071 
00072 /* Environments with 64-bit wide pointers can be provided,
00073    so these macros aren't defined:
00074    # undef _POSIX_V6_LP64_OFF64
00075    # undef _POSIX_V6_LPBIG_OFFBIG
00076    # undef _XBS5_LP64_OFF64
00077    # undef _XBS5_LPBIG_OFFBIG
00078    and sysconf tests for it at runtime.  */
00079 
00080 #endif /* __WORDSIZE == 32 */
00081 
00082 #define __ILP32_OFF32_CFLAGS       "-m32"
00083 #define __ILP32_OFFBIG_CFLAGS      "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
00084 #define __ILP32_OFF32_LDFLAGS      "-m32"
00085 #define __ILP32_OFFBIG_LDFLAGS     "-m32"
00086 #define __LP64_OFF64_CFLAGS "-m64"
00087 #define __LP64_OFF64_LDFLAGS       "-m64"