comparison src/os/win32/ngx_win32_config.h @ 5886:5d4e4619982f

Win32: made build-able with MinGW-w64 gcc.
author Kouhei Sutou <kou@cozmixng.org>
date Wed, 15 Oct 2014 21:15:01 +0900
parents 72e31d88defa
children b92d5a26d55f
comparison
equal deleted inserted replaced
5885:5a042519bfe7 5886:5d4e4619982f
35 #include <ws2tcpip.h> /* ipv6 */ 35 #include <ws2tcpip.h> /* ipv6 */
36 #include <mswsock.h> 36 #include <mswsock.h>
37 #include <shellapi.h> 37 #include <shellapi.h>
38 #include <stddef.h> /* offsetof() */ 38 #include <stddef.h> /* offsetof() */
39 39
40 #ifdef __GNUC__ 40 #ifdef __MINGW64_VERSION_MAJOR
41
42 /* GCC MinGW-w64 supports _FILE_OFFSET_BITS */
43 #define _FILE_OFFSET_BITS 64
44
45 #elif defined __GNUC__
46
41 /* GCC MinGW's stdio.h includes sys/types.h */ 47 /* GCC MinGW's stdio.h includes sys/types.h */
42 #define _OFF_T_ 48 #define _OFF_T_
49
43 #endif 50 #endif
44 51
45 #include <stdio.h> 52 #include <stdio.h>
46 #include <stdlib.h> 53 #include <stdlib.h>
47 #include <stdarg.h> 54 #include <stdarg.h>
55 #ifdef __MINGW64_VERSION_MAJOR
56 #include <stdint.h>
57 #endif
48 #include <ctype.h> 58 #include <ctype.h>
49 #include <locale.h> 59 #include <locale.h>
50 60
51 #ifdef __WATCOMC__ 61 #ifdef __WATCOMC__
52 #define _TIME_T_DEFINED 62 #define _TIME_T_DEFINED
134 #endif 144 #endif
135 145
136 typedef __int64 int64_t; 146 typedef __int64 int64_t;
137 typedef unsigned __int64 uint64_t; 147 typedef unsigned __int64 uint64_t;
138 148
139 #ifndef __WATCOMC__ 149 #if !defined(__WATCOMC__) && !defined(__MINGW64_VERSION_MAJOR)
140 typedef int intptr_t; 150 typedef int intptr_t;
141 typedef u_int uintptr_t; 151 typedef u_int uintptr_t;
142 #endif 152 #endif
143 153
154
155 #ifndef __MINGW64_VERSION_MAJOR
144 156
145 /* Windows defines off_t as long, which is 32-bit */ 157 /* Windows defines off_t as long, which is 32-bit */
146 typedef __int64 off_t; 158 typedef __int64 off_t;
147 #define _OFF_T_DEFINED 159 #define _OFF_T_DEFINED
160
161 #endif
162
148 163
149 #ifdef __WATCOMC__ 164 #ifdef __WATCOMC__
150 165
151 /* off_t is redefined by sys/types.h used by zlib.h */ 166 /* off_t is redefined by sys/types.h used by zlib.h */
152 #define __TYPES_H_INCLUDED 167 #define __TYPES_H_INCLUDED
162 typedef unsigned int ino_t; 177 typedef unsigned int ino_t;
163 178
164 #endif 179 #endif
165 180
166 181
182 #ifndef __MINGW64_VERSION_MAJOR
167 typedef int ssize_t; 183 typedef int ssize_t;
184 #endif
185
186
168 typedef uint32_t in_addr_t; 187 typedef uint32_t in_addr_t;
169 typedef u_short in_port_t; 188 typedef u_short in_port_t;
170 typedef int sig_atomic_t; 189 typedef int sig_atomic_t;
171 190
191
192 #ifdef _WIN64
193
194 #define NGX_PTR_SIZE 8
195 #define NGX_SIZE_T_LEN (sizeof("-9223372036854775808") - 1)
196 #define NGX_MAX_SIZE_T_VALUE 9223372036854775807
197 #define NGX_TIME_T_LEN (sizeof("-9223372036854775808") - 1)
198 #define NGX_TIME_T_SIZE 8
199
200 #else
172 201
173 #define NGX_PTR_SIZE 4 202 #define NGX_PTR_SIZE 4
174 #define NGX_SIZE_T_LEN (sizeof("-2147483648") - 1) 203 #define NGX_SIZE_T_LEN (sizeof("-2147483648") - 1)
175 #define NGX_MAX_SIZE_T_VALUE 2147483647 204 #define NGX_MAX_SIZE_T_VALUE 2147483647
176 #define NGX_TIME_T_LEN (sizeof("-2147483648") - 1) 205 #define NGX_TIME_T_LEN (sizeof("-2147483648") - 1)
177 #define NGX_TIME_T_SIZE 4 206 #define NGX_TIME_T_SIZE 4
207
208 #endif
209
210
178 #define NGX_OFF_T_LEN (sizeof("-9223372036854775807") - 1) 211 #define NGX_OFF_T_LEN (sizeof("-9223372036854775807") - 1)
179 #define NGX_MAX_OFF_T_VALUE 9223372036854775807 212 #define NGX_MAX_OFF_T_VALUE 9223372036854775807
180 #define NGX_SIG_ATOMIC_T_SIZE 4 213 #define NGX_SIG_ATOMIC_T_SIZE 4
181 214
182 215