From f6e00ae128ab9d92a71abd3fabb9360dc497bcfe Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu, 19 Oct 2006 20:03:08 +0000
Subject: [PATCH] Further MSVC portability fixes from Magnus.

---
 contrib/earthdistance/earthdistance.c |  5 ++++-
 src/include/port/win32.h              | 15 ++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/contrib/earthdistance/earthdistance.c b/contrib/earthdistance/earthdistance.c
index 1f7baa3c30a..b60370483ba 100644
--- a/contrib/earthdistance/earthdistance.c
+++ b/contrib/earthdistance/earthdistance.c
@@ -1,7 +1,10 @@
-/* $PostgreSQL: pgsql/contrib/earthdistance/earthdistance.c,v 1.11 2006/05/30 22:12:12 tgl Exp $ */
+/* $PostgreSQL: pgsql/contrib/earthdistance/earthdistance.c,v 1.12 2006/10/19 20:03:07 tgl Exp $ */
 
 #include "postgres.h"
 
+#ifdef WIN32
+#define _USE_MATH_DEFINES
+#endif
 #include <math.h>
 
 #include "utils/geo_decls.h"	/* for Pt */
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index e3bc767689a..b23123bc4ab 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.62 2006/10/04 00:30:10 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.63 2006/10/19 20:03:08 tgl Exp $ */
 
 #if defined(_MSC_VER) || defined(__BORLANDC__)
 #define WIN32_ONLY_COMPILER
@@ -289,6 +289,19 @@ typedef unsigned short mode_t;
 #define isnan(x) _isnan(x)
 #define finite(x) _finite(x)
 
+#ifndef			BIG_ENDIAN
+#define			BIG_ENDIAN		4321
+#endif
+#ifndef			LITTLE_ENDIAN
+#define			LITTLE_ENDIAN	1234
+#endif
+#ifndef			PDP_ENDIAN
+#define			PDP_ENDIAN		3412
+#endif
+
+#ifndef BYTE_ORDER
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
 
 /* Pulled from Makefile.port in mingw */
 #define DLSUFFIX ".dll"
-- 
GitLab