From ca5a75fbaed63f41c6e52e5d4b35470080356bdf Mon Sep 17 00:00:00 2001
From: Andrew Dunstan <andrew@dunslane.net>
Date: Tue, 19 Apr 2011 11:21:00 -0400
Subject: [PATCH] Silence compiler warning about casting HANDLE to long on
 WIN64.

---
 src/test/regress/pg_regress.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index b9ae622b04b..5fe3724c82e 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2277,8 +2277,14 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
 
 		postmaster_running = true;
 
+#ifdef WIN64
+/* need a series of two casts to convert HANDLE without compiler warning */
+#define ULONGPID(x) (unsigned long) (unsigned long long) (x)
+#else
+#define ULONGPID(x) (unsigned long) (x)
+#endif
 		printf(_("running on port %d with pid %lu\n"),
-			   port, (unsigned long) postmaster_pid);
+			   port, ULONGPID(postmaster_pid));
 	}
 	else
 	{
-- 
GitLab