2008-05-17 03:28:26 +02:00
|
|
|
/*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/interfaces/libpq/win32.h
|
2008-05-17 03:28:26 +02:00
|
|
|
*/
|
2002-07-20 07:43:31 +02:00
|
|
|
#ifndef __win32_h_included
|
|
|
|
#define __win32_h_included
|
1998-07-03 06:24:16 +02:00
|
|
|
|
|
|
|
/*
|
2004-05-07 02:24:59 +02:00
|
|
|
* Some compatibility functions
|
1998-07-03 06:24:16 +02:00
|
|
|
*/
|
2002-12-30 22:07:26 +01:00
|
|
|
#ifdef __BORLANDC__
|
|
|
|
#define _timeb timeb
|
|
|
|
#define _ftime(a) ftime(a)
|
|
|
|
#define _errno errno
|
2004-07-31 08:19:23 +02:00
|
|
|
#define popen(a,b) _popen(a,b)
|
2002-12-30 22:07:26 +01:00
|
|
|
#else
|
2004-03-24 04:54:16 +01:00
|
|
|
/* open provided elsewhere */
|
2000-02-08 00:10:11 +01:00
|
|
|
#define close(a) _close(a)
|
1998-07-03 06:24:16 +02:00
|
|
|
#define read(a,b,c) _read(a,b,c)
|
|
|
|
#define write(a,b,c) _write(a,b,c)
|
2002-12-30 22:07:26 +01:00
|
|
|
#endif
|
|
|
|
|
2001-10-25 07:50:21 +02:00
|
|
|
#undef EAGAIN /* doesn't apply on sockets */
|
2001-08-04 00:11:39 +02:00
|
|
|
#undef EINTR
|
2001-07-20 19:45:06 +02:00
|
|
|
#define EINTR WSAEINTR
|
2011-12-10 21:35:41 +01:00
|
|
|
#ifndef EWOULDBLOCK
|
2001-07-20 19:45:06 +02:00
|
|
|
#define EWOULDBLOCK WSAEWOULDBLOCK
|
2011-12-10 21:35:41 +01:00
|
|
|
#endif
|
|
|
|
#ifndef ECONNRESET
|
2001-07-20 19:45:06 +02:00
|
|
|
#define ECONNRESET WSAECONNRESET
|
2011-12-10 21:35:41 +01:00
|
|
|
#endif
|
|
|
|
#ifndef EINPROGRESS
|
2001-07-20 19:45:06 +02:00
|
|
|
#define EINPROGRESS WSAEINPROGRESS
|
2011-12-10 21:35:41 +01:00
|
|
|
#endif
|
2001-08-21 22:39:54 +02:00
|
|
|
|
|
|
|
/*
|
2001-11-28 20:40:29 +01:00
|
|
|
* support for handling Windows Socket errors
|
2001-08-21 22:39:54 +02:00
|
|
|
*/
|
2003-06-14 19:49:54 +02:00
|
|
|
extern const char *winsock_strerror(int err, char *strerrbuf, size_t buflen);
|
2002-07-20 07:43:31 +02:00
|
|
|
|
|
|
|
#endif
|