Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91812df

Browse files
committed
Enable building with the Mingw64 compiler.
This can be used to build 64 bit Windows binaries, not only on 64 bitWindows but on supported cross-compiling hosts including 32 bit Windows,Cygwin, Darwin and Linux.
1 parent9688c4e commit91812df

File tree

8 files changed

+32
-8
lines changed

8 files changed

+32
-8
lines changed

‎config/ac_func_accept_argtypes.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ dnl
3838
# 'int' as the result, because that ought to work best.
3939
#
4040
# On Win32, accept() returns 'unsigned int PASCAL'
41+
# Win64 uses SOCKET for return and arg1
4142

4243
AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES],
4344
[AC_MSG_CHECKING([types of arguments for accept()])
4445
AC_CACHE_VAL(ac_cv_func_accept_return,dnl
4546
[AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl
4647
[AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl
4748
[AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl
48-
[for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do
49-
for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
49+
[for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do
50+
for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
5051
for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
5152
for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
5253
AC_TRY_COMPILE(

‎configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18696,8 +18696,8 @@ else
1869618696
if test "${ac_cv_func_accept_arg3+set}" = set; then
1869718697
$as_echo_n "(cached) " >&6
1869818698
else
18699-
for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do
18700-
for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
18699+
for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do
18700+
for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
1870118701
for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
1870218702
for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
1870318703
cat >conftest.$ac_ext <<_ACEOF

‎src/include/c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#endif
5959
#include"postgres_ext.h"
6060

61-
#if_MSC_VER >=1400
61+
#if_MSC_VER >=1400|| defined(WIN64)
6262
#defineerrcode __msvc_errcode
6363
#include<crtdefs.h>
6464
#undef errcode

‎src/include/port.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,12 @@ extern FILE *pgwin32_fopen(const char *, const char *);
325325
#definefopen(a,b) pgwin32_fopen(a,b)
326326
#endif
327327

328+
#ifndefpopen
328329
#definepopen(a,b) _popen(a,b)
330+
#endif
331+
#ifndefpclose
329332
#definepclose(a) _pclose(a)
333+
#endif
330334

331335
/* New versions of MingW have gettimeofday, old mingw and msvc don't */
332336
#ifndefHAVE_GETTIMEOFDAY

‎src/include/port/win32.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
#defineWIN32_ONLY_COMPILER
55
#endif
66

7+
/*
8+
* Make sure _WIN32_WINNT has the minumum required value.
9+
* Leave a higher value in place.
10+
*/
11+
#if defined(_WIN32_WINNT)&&_WIN32_WINNT<0x0501
12+
#undefine _WIN32_WINNT
13+
#endif
14+
#ifndef_WIN32_WINNT
715
#define_WIN32_WINNT 0x0501
16+
#endif
817
/*
918
* Always build with SSPI support. Keep it as a #define in case
1019
* we want a switch to disable it sometime in the future.
@@ -17,10 +26,17 @@
1726
#undef mkdir
1827

1928
#undef ERROR
29+
30+
/*
31+
* The Mingw64 headers choke if this is already defined - they
32+
* define it themselves.
33+
*/
34+
#if !defined(WIN64)|| defined(WIN32_ONLY_COMPILER)
2035
#define_WINSOCKAPI_
21-
#include<windows.h>
36+
#endif
2237
#include<winsock2.h>
2338
#include<ws2tcpip.h>
39+
#include<windows.h>
2440
#undef small
2541
#include<process.h>
2642
#include<signal.h>

‎src/include/port/win32/sys/socket.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include<winsock2.h>
1515
#include<ws2tcpip.h>
16+
#include<windows.h>
1617

1718
#undef ERROR
1819
#undef small

‎src/port/getaddrinfo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@ gai_strerror(int errcode)
329329
return"Not enough memory";
330330
#endif
331331
#ifdefEAI_NODATA
332-
#ifndefWIN32_ONLY_COMPILER/* MSVC complains because another case has the
333-
* same value */
332+
#if !defined(WIN64)&& !defined(WIN32_ONLY_COMPILER)/* MSVC/WIN64 duplicate */
334333
caseEAI_NODATA:
335334
return"No host data of that type was found";
336335
#endif

‎src/test/regress/resultmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
float4:out:i.86-pc-mingw32=float4-exp-three-digits.out
2+
float4:out:x86_64-w64-mingw32=float4-exp-three-digits.out
23
float4:out:i.86-pc-win32vc=float4-exp-three-digits.out
34
float8:out:i.86-.*-freebsd=float8-small-is-zero.out
45
float8:out:i.86-.*-openbsd=float8-small-is-zero.out
56
float8:out:i.86-.*-netbsd=float8-small-is-zero.out
67
float8:out:m68k-.*-netbsd=float8-small-is-zero.out
78
float8:out:i.86-pc-mingw32=float8-exp-three-digits-win32.out
9+
float8:out:x86_64-w64-mingw32=float8-exp-three-digits-win32.out
810
float8:out:i.86-pc-win32vc=float8-exp-three-digits-win32.out
911
float8:out:i.86-pc-cygwin=float8-small-is-zero.out
1012
int8:out:i.86-pc-mingw32=int8-exp-three-digits.out
13+
int8:out:x86_64-w64-mingw32=int8-exp-three-digits.out
1114
int8:out:i.86-pc-win32vc=int8-exp-three-digits.out

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp