Fix last ChangeLog entry.
[gnulib.git] / lib / sys_types.in.h
blobacf9b2f754673be124202b7962d7fb6b36c56fb6
1 /* Provide a more complete sys/types.h.
3 Copyright (C) 2011-2025 Free Software Foundation, Inc.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file 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
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21 @PRAGMA_COLUMNS@
23 /* This file uses #include_next of a system file that defines time_t.
24 For the 'year2038' module to work right, <config.h> needs to have been
25 included before. */
26 #if !_GL_CONFIG_H_INCLUDED
27 #error "Please include config.h first."
28 #endif
30 #if defined _WIN32 && !defined __CYGWIN__ \
31 && (defined __need_off_t || defined __need___off64_t \
32 || defined __need_ssize_t || defined __need_time_t)
34 /* Special invocation convention inside mingw header files. */
36 #@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
38 #else
39 /* Normal invocation convention. */
41 #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
43 /* The include_next requires a split double-inclusion guard. */
44 # define _GL_INCLUDING_SYS_TYPES_H
45 #@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
46 # undef _GL_INCLUDING_SYS_TYPES_H
48 #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
49 #define _@GUARD_PREFIX@_SYS_TYPES_H
51 /* Override off_t if Large File Support is requested on native Windows. */
52 #if @WINDOWS_64_BIT_OFF_T@
53 /* Same as int64_t in <stdint.h>. */
54 # if defined _MSC_VER
55 # define off_t __int64
56 # else
57 # define off_t long long int
58 # endif
59 /* Indicator, for gnulib internal purposes. */
60 # define _GL_WINDOWS_64_BIT_OFF_T 1
61 #endif
63 /* Define the off64_t type. */
64 #if !@HAVE_OFF64_T@
65 # if !GNULIB_defined_off64_t
66 /* Define off64_t to int64_t always. */
67 typedef long long off64_t;
68 # define GNULIB_defined_off64_t 1
69 # endif
70 #endif
72 /* Override dev_t and ino_t if distinguishable inodes support is requested
73 on native Windows. */
74 #if @WINDOWS_STAT_INODES@
76 # if @WINDOWS_STAT_INODES@ == 2
77 /* Experimental, not useful in Windows 10. */
79 /* Define dev_t to a 64-bit type. */
80 # if !defined GNULIB_defined_dev_t
81 typedef unsigned long long int rpl_dev_t;
82 # undef dev_t
83 # define dev_t rpl_dev_t
84 # define GNULIB_defined_dev_t 1
85 # endif
87 /* Define ino_t to a 128-bit type. */
88 # if !defined GNULIB_defined_ino_t
89 /* MSVC does not have a 128-bit integer type.
90 GCC has a 128-bit integer type __int128, but only on 64-bit targets. */
91 typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t;
92 # undef ino_t
93 # define ino_t rpl_ino_t
94 # define GNULIB_defined_ino_t 1
95 # endif
97 # else /* @WINDOWS_STAT_INODES@ == 1 */
99 /* Define ino_t to a 64-bit type. */
100 # if !defined GNULIB_defined_ino_t
101 typedef unsigned long long int rpl_ino_t;
102 # undef ino_t
103 # define ino_t rpl_ino_t
104 # define GNULIB_defined_ino_t 1
105 # endif
107 # endif
109 /* Indicator, for gnulib internal purposes. */
110 # define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@
112 #endif
114 /* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
115 /* But avoid namespace pollution on glibc systems. */
116 #if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
117 # include <stddef.h>
118 #endif
120 /* Define blksize_t, required by POSIX:2024. */
121 #if !@HAVE_BLKSIZE_T@
122 # if !defined GNULIB_defined_blksize_t
123 typedef int blksize_t;
124 # define GNULIB_defined_blksize_t 1
125 # endif
126 #endif
128 /* Define blkcnt_t, required by POSIX:2024. */
129 #if !@HAVE_BLKCNT_T@
130 # if !defined GNULIB_defined_blkcnt_t
131 typedef long long blkcnt_t;
132 # define GNULIB_defined_blkcnt_t 1
133 # endif
134 #endif
136 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
137 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
138 #endif /* __need_XXX */