# 'int' as the result, because that ought to work best.
#
# On Win32, accept() returns 'unsigned int PASCAL'
+# Win64 uses SOCKET for return and arg1
AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES],
[AC_MSG_CHECKING([types of arguments for accept()])
[AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl
[AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl
[AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl
- [for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do
- for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
+ [for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do
+ for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
AC_TRY_COMPILE(
if test "${ac_cv_func_accept_arg3+set}" = set; then
$as_echo_n "(cached) " >&6
else
- for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do
- for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
+ for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do
+ for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
cat >conftest.$ac_ext <<_ACEOF
#endif
#include "postgres_ext.h"
-#if _MSC_VER >= 1400
+#if _MSC_VER >= 1400 || defined(WIN64)
#define errcode __msvc_errcode
#include <crtdefs.h>
#undef errcode
#define fopen(a,b) pgwin32_fopen(a,b)
#endif
+#ifndef popen
#define popen(a,b) _popen(a,b)
+#endif
+#ifndef pclose
#define pclose(a) _pclose(a)
+#endif
/* New versions of MingW have gettimeofday, old mingw and msvc don't */
#ifndef HAVE_GETTIMEOFDAY
#define WIN32_ONLY_COMPILER
#endif
+/*
+ * Make sure _WIN32_WINNT has the minumum required value.
+ * Leave a higher value in place.
+*/
+#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0501
+#undefine _WIN32_WINNT
+#endif
+#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
+#endif
/*
* Always build with SSPI support. Keep it as a #define in case
* we want a switch to disable it sometime in the future.
#undef mkdir
#undef ERROR
+
+/*
+ * The Mingw64 headers choke if this is already defined - they
+ * define it themselves.
+ */
+#if !defined(WIN64) || defined(WIN32_ONLY_COMPILER)
#define _WINSOCKAPI_
-#include <windows.h>
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
+#include <windows.h>
#undef small
#include <process.h>
#include <signal.h>
*/
#include <winsock2.h>
#include <ws2tcpip.h>
+#include <windows.h>
#undef ERROR
#undef small
return "Not enough memory";
#endif
#ifdef EAI_NODATA
-#ifndef WIN32_ONLY_COMPILER /* MSVC complains because another case has the
- * same value */
+#if !defined(WIN64) && !defined(WIN32_ONLY_COMPILER) /* MSVC/WIN64 duplicate */
case EAI_NODATA:
return "No host data of that type was found";
#endif
float4:out:i.86-pc-mingw32=float4-exp-three-digits.out
+float4:out:x86_64-w64-mingw32=float4-exp-three-digits.out
float4:out:i.86-pc-win32vc=float4-exp-three-digits.out
float8:out:i.86-.*-freebsd=float8-small-is-zero.out
float8:out:i.86-.*-openbsd=float8-small-is-zero.out
float8:out:i.86-.*-netbsd=float8-small-is-zero.out
float8:out:m68k-.*-netbsd=float8-small-is-zero.out
float8:out:i.86-pc-mingw32=float8-exp-three-digits-win32.out
+float8:out:x86_64-w64-mingw32=float8-exp-three-digits-win32.out
float8:out:i.86-pc-win32vc=float8-exp-three-digits-win32.out
float8:out:i.86-pc-cygwin=float8-small-is-zero.out
int8:out:i.86-pc-mingw32=int8-exp-three-digits.out
+int8:out:x86_64-w64-mingw32=int8-exp-three-digits.out
int8:out:i.86-pc-win32vc=int8-exp-three-digits.out