Mercurial > hg > nginx
diff src/os/win32/ngx_win32_config.h @ 5360:3d2d3e1cf427
Win32: MinGW GCC compatibility.
Several warnings silenced, notably (ngx_socket_t) -1 is now checked
on socket operations instead of -1, as ngx_socket_t is unsigned on win32
and gcc complains on comparison.
With this patch, it's now possible to compile nginx using mingw gcc,
with options we normally compile on win32.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 04 Sep 2013 20:48:28 +0400 |
parents | 2fda9065d0f4 |
children | 72e31d88defa |
line wrap: on
line diff
--- a/src/os/win32/ngx_win32_config.h +++ b/src/os/win32/ngx_win32_config.h @@ -9,6 +9,7 @@ #define _NGX_WIN32_CONFIG_H_INCLUDED_ +#undef WIN32 #define WIN32 0x0400 #define _WIN32_WINNT 0x0501 @@ -35,6 +36,12 @@ #include <mswsock.h> #include <shellapi.h> #include <stddef.h> /* offsetof() */ + +#ifdef __GNUC__ +/* GCC MinGW's stdio.h includes sys/types.h */ +#define _OFF_T_ +#endif + #include <stdio.h> #include <stdlib.h> #include <stdarg.h>