environments.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _UNISTD_H
  16. # error "Never include this file directly. Use <unistd.h> instead"
  17. #endif
  18. #include <bits/wordsize.h>
  19. /* This header should define the following symbols under the described
  20. situations. A value `1' means that the model is always supported,
  21. `-1' means it is never supported. Undefined means it cannot be
  22. statically decided.
  23. _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type
  24. _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
  25. _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type
  26. _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type
  27. The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
  28. _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
  29. _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
  30. used in previous versions of the Unix standard and are available
  31. only for compatibility.
  32. */
  33. #if __WORDSIZE == 64
  34. /* Environments with 32-bit wide pointers are optionally provided.
  35. Therefore following macros aren't defined:
  36. # undef _POSIX_V7_ILP32_OFF32
  37. # undef _POSIX_V7_ILP32_OFFBIG
  38. # undef _POSIX_V6_ILP32_OFF32
  39. # undef _POSIX_V6_ILP32_OFFBIG
  40. # undef _XBS5_ILP32_OFF32
  41. # undef _XBS5_ILP32_OFFBIG
  42. and users need to check at runtime. */
  43. /* We also have no use (for now) for an environment with bigger pointers
  44. and offsets. */
  45. # define _POSIX_V7_LPBIG_OFFBIG -1
  46. # define _POSIX_V6_LPBIG_OFFBIG -1
  47. # define _XBS5_LPBIG_OFFBIG -1
  48. /* By default we have 64-bit wide `long int', pointers and `off_t'. */
  49. # define _POSIX_V7_LP64_OFF64 1
  50. # define _POSIX_V6_LP64_OFF64 1
  51. # define _XBS5_LP64_OFF64 1
  52. #else /* __WORDSIZE == 32 */
  53. /* By default we have 32-bit wide `int', `long int', pointers and `off_t'
  54. and all platforms support LFS. */
  55. # define _POSIX_V7_ILP32_OFF32 1
  56. # define _POSIX_V7_ILP32_OFFBIG 1
  57. # define _POSIX_V6_ILP32_OFF32 1
  58. # define _POSIX_V6_ILP32_OFFBIG 1
  59. # define _XBS5_ILP32_OFF32 1
  60. # define _XBS5_ILP32_OFFBIG 1
  61. /* We optionally provide an environment with the above size but an 64-bit
  62. side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */
  63. /* Environments with 64-bit wide pointers can be provided,
  64. so these macros aren't defined:
  65. # undef _POSIX_V7_LP64_OFF64
  66. # undef _POSIX_V7_LPBIG_OFFBIG
  67. # undef _POSIX_V6_LP64_OFF64
  68. # undef _POSIX_V6_LPBIG_OFFBIG
  69. # undef _XBS5_LP64_OFF64
  70. # undef _XBS5_LPBIG_OFFBIG
  71. and sysconf tests for it at runtime. */
  72. #endif /* __WORDSIZE == 32 */
  73. #define __ILP32_OFF32_CFLAGS "-m32"
  74. #define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
  75. #define __ILP32_OFF32_LDFLAGS "-m32"
  76. #define __ILP32_OFFBIG_LDFLAGS "-m32"
  77. #define __LP64_OFF64_CFLAGS "-m64"
  78. #define __LP64_OFF64_LDFLAGS "-m64"