From 0fb54de9aa4ffb792ea63af853146021ae501f12 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Fri, 29 Apr 2016 07:59:47 -0400 Subject: Support building with Visual Studio 2015 Adjust the way we detect the locale. As a result the minumum Windows version supported by VS2015 and later is Windows Vista. Add some tweaks to remove new compiler warnings. Remove documentation references to the now obsolete msysGit. Michael Paquier, somewhat edited by me, reviewed by Christian Ullrich. Backpatch to 9.5 --- src/bin/pg_basebackup/pg_basebackup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/bin/pg_basebackup/pg_basebackup.c') diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 5676d501229..2927b60cc2d 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1830,6 +1830,11 @@ BaseBackup(void) int r; #else DWORD status; + /* + * get a pointer sized version of bgchild to avoid warnings about + * casting to a different size on WIN64. + */ + intptr_t bgchild_handle = bgchild; uint32 hi, lo; #endif @@ -1892,7 +1897,7 @@ BaseBackup(void) InterlockedIncrement(&has_xlogendptr); /* First wait for the thread to exit */ - if (WaitForSingleObjectEx((HANDLE) bgchild, INFINITE, FALSE) != + if (WaitForSingleObjectEx((HANDLE) bgchild_handle, INFINITE, FALSE) != WAIT_OBJECT_0) { _dosmaperr(GetLastError()); @@ -1900,7 +1905,7 @@ BaseBackup(void) progname, strerror(errno)); disconnect_and_exit(1); } - if (GetExitCodeThread((HANDLE) bgchild, &status) == 0) + if (GetExitCodeThread((HANDLE) bgchild_handle, &status) == 0) { _dosmaperr(GetLastError()); fprintf(stderr, _("%s: could not get child thread exit status: %s\n"), -- cgit v1.2.3