From c554bf878fb0b4adcb6a4f7292e055b8d4567d4b Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Tue, 8 Aug 2006 18:49:14 +0000
Subject: [PATCH] Fix definition of "errcode" for MSVC.

Hiroshi Saito
---
 src/include/c.h          | 4 +---
 src/include/port/win32.h | 5 ++++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/include/c.h b/src/include/c.h
index 3aa1d918194..3aa958d7dc8 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
  * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/c.h,v 1.208 2006/07/29 17:35:07 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.209 2006/08/08 18:49:14 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -60,11 +60,9 @@
 
 #if defined(_MSC_VER) || defined(__BORLANDC__)
 #define	WIN32_ONLY_COMPILER
-#define errcode __vc_errcode
 #if defined(__BORLANDC__) || (_MSC_VER > 1400)
 #include <crtdefs.h>
 #endif
-#undef errcode
 #endif
 
 #include <stdio.h>
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index fa57c25b3c2..e6057093cc4 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.54 2006/07/30 01:45:21 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.55 2006/08/08 18:49:14 momjian Exp $ */
 
 /* undefine and redefine after #include */
 #undef mkdir
@@ -262,6 +262,9 @@ typedef unsigned short mode_t;
 #define inline __inline
 #define __inline__ __inline
 
+#undef errcode
+#define errcode __vc_errcode
+
 #define _S_IRWXU	(_S_IREAD | _S_IWRITE | _S_IEXEC)
 #define _S_IXUSR	_S_IEXEC
 #define _S_IWUSR	_S_IWRITE
-- 
GitLab