sys_types.in.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* Provide a more complete sys/types.h.
  2. Copyright (C) 2011-2022 Free Software Foundation, Inc.
  3. This file is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as
  5. published by the Free Software Foundation; either version 2.1 of the
  6. License, or (at your option) any later version.
  7. This file 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
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  13. #if __GNUC__ >= 3
  14. @PRAGMA_SYSTEM_HEADER@
  15. #endif
  16. @PRAGMA_COLUMNS@
  17. #if defined _WIN32 && !defined __CYGWIN__ \
  18. && (defined __need_off_t || defined __need___off64_t \
  19. || defined __need_ssize_t || defined __need_time_t)
  20. /* Special invocation convention inside mingw header files. */
  21. #@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
  22. #else
  23. /* Normal invocation convention. */
  24. #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
  25. /* The include_next requires a split double-inclusion guard. */
  26. # define _GL_INCLUDING_SYS_TYPES_H
  27. #@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
  28. # undef _GL_INCLUDING_SYS_TYPES_H
  29. #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
  30. #define _@GUARD_PREFIX@_SYS_TYPES_H
  31. /* Override off_t if Large File Support is requested on native Windows. */
  32. #if @WINDOWS_64_BIT_OFF_T@
  33. /* Same as int64_t in <stdint.h>. */
  34. # if defined _MSC_VER
  35. # define off_t __int64
  36. # else
  37. # define off_t long long int
  38. # endif
  39. /* Indicator, for gnulib internal purposes. */
  40. # define _GL_WINDOWS_64_BIT_OFF_T 1
  41. #endif
  42. /* Override dev_t and ino_t if distinguishable inodes support is requested
  43. on native Windows. */
  44. #if @WINDOWS_STAT_INODES@
  45. # if @WINDOWS_STAT_INODES@ == 2
  46. /* Experimental, not useful in Windows 10. */
  47. /* Define dev_t to a 64-bit type. */
  48. # if !defined GNULIB_defined_dev_t
  49. typedef unsigned long long int rpl_dev_t;
  50. # undef dev_t
  51. # define dev_t rpl_dev_t
  52. # define GNULIB_defined_dev_t 1
  53. # endif
  54. /* Define ino_t to a 128-bit type. */
  55. # if !defined GNULIB_defined_ino_t
  56. /* MSVC does not have a 128-bit integer type.
  57. GCC has a 128-bit integer type __int128, but only on 64-bit targets. */
  58. typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t;
  59. # undef ino_t
  60. # define ino_t rpl_ino_t
  61. # define GNULIB_defined_ino_t 1
  62. # endif
  63. # else /* @WINDOWS_STAT_INODES@ == 1 */
  64. /* Define ino_t to a 64-bit type. */
  65. # if !defined GNULIB_defined_ino_t
  66. typedef unsigned long long int rpl_ino_t;
  67. # undef ino_t
  68. # define ino_t rpl_ino_t
  69. # define GNULIB_defined_ino_t 1
  70. # endif
  71. # endif
  72. /* Indicator, for gnulib internal purposes. */
  73. # define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@
  74. #endif
  75. /* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
  76. /* But avoid namespace pollution on glibc systems. */
  77. #if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
  78. # include <stddef.h>
  79. #endif
  80. #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
  81. #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
  82. #endif /* __need_XXX */