提交 808849e5 编写于 作者: T Tom Lane

Fix lack of repeat-inclusion guard in win32 substitute sys/socket.h.

I think this explains the 'implicit declaration of function gai_strerror'
warnings visible in the current buildfarm report from snake: if
sys/socket.h is included again after getaddrinfo.h, the file would
merrily undefine the gai_strerror macro.
上级 3ff58b48
/*
* $PostgreSQL: pgsql/src/include/port/win32/sys/socket.h,v 1.6 2006/07/16 01:35:28 tgl Exp $
*/
#ifndef WIN32_SYS_SOCKET_H
#define WIN32_SYS_SOCKET_H
/* /*
* Unfortunately, <wingdi.h> of VC++ also defines ERROR. * Unfortunately, <wingdi.h> of VC++ also defines ERROR.
* To avoid the conflict, we include <windows.h> here and undefine ERROR * To avoid the conflict, we include <windows.h> here and undefine ERROR
...@@ -7,12 +13,14 @@ ...@@ -7,12 +13,14 @@
*/ */
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#undef ERROR #undef ERROR
#undef small #undef small
/* Restore old ERROR value */ /* Restore old ERROR value */
#ifdef PGERROR #ifdef PGERROR
#define ERROR PGERROR #define ERROR PGERROR
#endif
/* /*
* we can't use the windows gai_strerror{AW} functions because * we can't use the windows gai_strerror{AW} functions because
...@@ -21,4 +29,4 @@ ...@@ -21,4 +29,4 @@
*/ */
#undef gai_strerror #undef gai_strerror
#endif #endif /* WIN32_SYS_SOCKET_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册