Update copyright notices with scripts/update-copyrights
[glibc.git] / ports / sysdeps / unix / sysv / linux / tile / bits / environments.h
blobd7003aa92ea95c337bbb7f1d34e2aaa4803d65ce
1 /* Copyright (C) 2011-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _UNISTD_H
20 # error "Never include this file directly. Use <unistd.h> instead"
21 #endif
23 #include <bits/wordsize.h>
25 /* This header should define the following symbols under the described
26 situations. A value `1' means that the model is always supported,
27 `-1' means it is never supported. Undefined means it cannot be
28 statically decided.
30 _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type
31 _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
33 _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type
34 _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type
36 The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
37 _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
38 _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
39 used in previous versions of the Unix standard and are available
40 only for compatibility.
43 #if __WORDSIZE == 64
45 /* Environments with 32-bit wide pointers are optionally provided.
46 Therefore following macros aren't defined:
47 # undef _POSIX_V7_ILP32_OFF32
48 # undef _POSIX_V7_ILP32_OFFBIG
49 # undef _POSIX_V6_ILP32_OFF32
50 # undef _POSIX_V6_ILP32_OFFBIG
51 # undef _XBS5_ILP32_OFF32
52 # undef _XBS5_ILP32_OFFBIG
53 and users need to check at runtime. */
55 /* We also have no use (for now) for an environment with bigger pointers
56 and offsets. */
57 # define _POSIX_V7_LPBIG_OFFBIG -1
58 # define _POSIX_V6_LPBIG_OFFBIG -1
59 # define _XBS5_LPBIG_OFFBIG -1
61 /* By default we have 64-bit wide `long int', pointers and `off_t'. */
62 # define _POSIX_V7_LP64_OFF64 1
63 # define _POSIX_V6_LP64_OFF64 1
64 # define _XBS5_LP64_OFF64 1
66 #else /* __WORDSIZE == 32 */
68 /* By default we have 32-bit wide `int', `long int', pointers and `off_t'
69 and all platforms support LFS. */
70 # define _POSIX_V7_ILP32_OFF32 1
71 # define _POSIX_V7_ILP32_OFFBIG 1
72 # define _POSIX_V6_ILP32_OFF32 1
73 # define _POSIX_V6_ILP32_OFFBIG 1
74 # define _XBS5_ILP32_OFF32 1
75 # define _XBS5_ILP32_OFFBIG 1
77 /* We optionally provide an environment with the above size but an 64-bit
78 side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */
80 /* Environments with 64-bit wide pointers can be provided,
81 so these macros aren't defined:
82 # undef _POSIX_V7_LP64_OFF64
83 # undef _POSIX_V7_LPBIG_OFFBIG
84 # undef _POSIX_V6_LP64_OFF64
85 # undef _POSIX_V6_LPBIG_OFFBIG
86 # undef _XBS5_LP64_OFF64
87 # undef _XBS5_LPBIG_OFFBIG
88 and sysconf tests for it at runtime. */
90 #endif /* __WORDSIZE == 32 */
92 #ifdef __tilegx__
93 /* Only TILE-Gx has the ability to choose 32- or 64-bit. */
94 #define __ILP32_OFF32_CFLAGS "-m32"
95 #define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
96 #define __ILP32_OFF32_LDFLAGS "-m32"
97 #define __ILP32_OFFBIG_LDFLAGS "-m32"
98 #define __LP64_OFF64_CFLAGS "-m64"
99 #define __LP64_OFF64_LDFLAGS "-m64"
100 #endif