environments.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _UNISTD_H
  15. # error "Never include this file directly. Use <unistd.h> instead"
  16. #endif
  17. #include <bits/wordsize.h>
  18. /* This header should define the following symbols under the described
  19. situations. A value `1' means that the model is always supported,
  20. `-1' means it is never supported. Undefined means it cannot be
  21. statically decided.
  22. _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type
  23. _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
  24. _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type
  25. _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type
  26. The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
  27. _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
  28. _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
  29. used in previous versions of the Unix standard and are available
  30. only for compatibility.
  31. */
  32. #if __WORDSIZE == 64
  33. /* We can never provide environments with 32-bit wide pointers. */
  34. # define _POSIX_V7_ILP32_OFF32 -1
  35. # define _POSIX_V7_ILP32_OFFBIG -1
  36. # define _POSIX_V6_ILP32_OFF32 -1
  37. # define _POSIX_V6_ILP32_OFFBIG -1
  38. # define _XBS5_ILP32_OFF32 -1
  39. # define _XBS5_ILP32_OFFBIG -1
  40. /* We also have no use (for now) for an environment with bigger pointers
  41. and offsets. */
  42. # define _POSIX_V7_LPBIG_OFFBIG -1
  43. # define _POSIX_V6_LPBIG_OFFBIG -1
  44. # define _XBS5_LPBIG_OFFBIG -1
  45. /* By default we have 64-bit wide `long int', pointers and `off_t'. */
  46. # define _POSIX_V7_LP64_OFF64 1
  47. # define _POSIX_V6_LP64_OFF64 1
  48. # define _XBS5_LP64_OFF64 1
  49. #else /* __WORDSIZE == 32 */
  50. /* By default we have 32-bit wide `int', `long int', pointers and `off_t'
  51. and all platforms support LFS. */
  52. # define _POSIX_V7_ILP32_OFF32 1
  53. # define _POSIX_V7_ILP32_OFFBIG 1
  54. # define _POSIX_V6_ILP32_OFF32 1
  55. # define _POSIX_V6_ILP32_OFFBIG 1
  56. # define _XBS5_ILP32_OFF32 1
  57. # define _XBS5_ILP32_OFFBIG 1
  58. /* We optionally provide an environment with the above size but an 64-bit
  59. side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */
  60. /* We can never provide environments with 64-bit wide pointers. */
  61. # define _POSIX_V7_LP64_OFF64 -1
  62. # define _POSIX_V7_LPBIG_OFFBIG -1
  63. # define _POSIX_V6_LP64_OFF64 -1
  64. # define _POSIX_V6_LPBIG_OFFBIG -1
  65. # define _XBS5_LP64_OFF64 -1
  66. # define _XBS5_LPBIG_OFFBIG -1
  67. /* CFLAGS. */
  68. #define __ILP32_OFFBIG_CFLAGS "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
  69. #endif /* __WORDSIZE == 32 */