mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Win32: MSVC 2015 compatibility.
Resolved warnings about declarations that hide previous local declarations. Warnings about WSASocketA() being deprecated resolved by explicit use of WSASocketW() instead of WSASocket(). When compiling without IPv6 support, WinSock deprecated warnings are disabled to allow use of gethostbyname().
This commit is contained in:
@@ -21,9 +21,9 @@ typedef int socklen_t;
|
||||
|
||||
|
||||
#define ngx_socket(af, type, proto) \
|
||||
WSASocket(af, type, proto, NULL, 0, WSA_FLAG_OVERLAPPED)
|
||||
WSASocketW(af, type, proto, NULL, 0, WSA_FLAG_OVERLAPPED)
|
||||
|
||||
#define ngx_socket_n "WSASocket()"
|
||||
#define ngx_socket_n "WSASocketW()"
|
||||
|
||||
int ngx_nonblocking(ngx_socket_t s);
|
||||
int ngx_blocking(ngx_socket_t s);
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
|
||||
/* enable gethostbyname() in msvc2015 */
|
||||
#if !(NGX_HAVE_INET6)
|
||||
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* we need to include <windows.h> explicitly before <winsock2.h> because
|
||||
* the warning 4201 is enabled in <windows.h>
|
||||
|
||||
Reference in New Issue
Block a user