diff options
| author | Andrew Dunstan | 2011-12-10 20:35:41 +0000 |
|---|---|---|
| committer | Andrew Dunstan | 2011-12-10 20:35:41 +0000 |
| commit | 1a0c76c32fe470142d3663dd84ac960d75a4e8db (patch) | |
| tree | d783c0f17e41b6a627b3750e92bb60b301215a8b /src/include | |
| parent | ab7d4213f93f0ef0e45b9b9343725974f196b091 (diff) | |
Enable compiling with the mingw-w64 32 bit compiler.
Original patch by Lars Kanis, reviewed by Nishiyama Tomoaki and tweaked some by me.
This compiler, or at least the latest version of it, is currently broken, and
only passes the regression tests if built with -O0.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/c.h | 3 | ||||
| -rw-r--r-- | src/include/pg_config.h.in | 3 | ||||
| -rw-r--r-- | src/include/port/win32.h | 26 |
3 files changed, 30 insertions, 2 deletions
diff --git a/src/include/c.h b/src/include/c.h index 0391860846..cb9b150f8a 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -58,7 +58,8 @@ #endif #include "postgres_ext.h" -#if _MSC_VER >= 1400 || defined(WIN64) +#define HAVE_CRTDEFS_H 1 +#if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H) #define errcode __msvc_errcode #include <crtdefs.h> #undef errcode diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 15fe0bfff4..b969d8c8e6 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -99,6 +99,9 @@ /* Define to 1 if you have the `class' function. */ #undef HAVE_CLASS +/* Define to 1 if you have the <crtdefs.h> header file. */ +#undef HAVE_CRTDEFS_H + /* Define to 1 if you have the `crypt' function. */ #undef HAVE_CRYPT diff --git a/src/include/port/win32.h b/src/include/port/win32.h index 34f4004129..afc96283eb 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -31,7 +31,7 @@ * The Mingw64 headers choke if this is already defined - they * define it themselves. */ -#if !defined(WIN64) || defined(WIN32_ONLY_COMPILER) +#if !defined(__MINGW64_VERSION_MAJOR) || defined(WIN32_ONLY_COMPILER) #define _WINSOCKAPI_ #endif #include <winsock2.h> @@ -225,9 +225,13 @@ int setitimer(int which, const struct itimerval * value, struct itimerval * ov #define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin) #define ftello(stream) _ftelli64(stream) #else +#ifndef fseeko #define fseeko(stream, offset, origin) fseeko64(stream, offset, origin) +#endif +#ifndef ftello #define ftello(stream) ftello64(stream) #endif +#endif /* * Supplement to <sys/types.h>. @@ -264,16 +268,36 @@ typedef int pid_t; #undef EINTR #define EINTR WSAEINTR #define EAGAIN WSAEWOULDBLOCK +#ifndef EMSGSIZE #define EMSGSIZE WSAEMSGSIZE +#endif +#ifndef EAFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT +#endif +#ifndef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK +#endif +#ifndef ECONNRESET #define ECONNRESET WSAECONNRESET +#endif +#ifndef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS +#endif +#ifndef ENOBUFS #define ENOBUFS WSAENOBUFS +#endif +#ifndef EPROTONOSUPPORT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#endif +#ifndef ECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED +#endif +#ifndef EBADFD #define EBADFD WSAENOTSOCK +#endif +#ifndef EOPNOTSUPP #define EOPNOTSUPP WSAEOPNOTSUPP +#endif /* * Extended locale functions with gratuitous underscore prefixes. |
