]> granicus.if.org Git - postgresql/commitdiff
Attached patch is required ot build with the CRT that comes with Visual
authorBruce Momjian <bruce@momjian.us>
Thu, 6 Jul 2006 01:55:51 +0000 (01:55 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 6 Jul 2006 01:55:51 +0000 (01:55 +0000)
Studio 2005. Basically MS defined errcode in the headers with a typedef,
so we have to #define it out of the way.

While at it, fix a function declaration in plpython that didn't match
the implementation (volatile missing).

Magnus Hagander

src/include/c.h
src/pl/plpython/plpython.c

index 2b51e2ac0a77fca67023918cdbbb38d56d2d1090..bd09a430edc4ed67f6739a1bffa4c9f3dde4fe57 100644 (file)
@@ -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.205 2006/06/26 23:53:14 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.206 2006/07/06 01:55:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -59,6 +59,9 @@
 
 #if defined(_MSC_VER) || defined(__BORLANDC__)
 #define        WIN32_ONLY_COMPILER
+#define errcode __vc_errcode
+#include <crtdefs.h>
+#undef errcode
 #endif
 
 #include <stdio.h>
index 20974bb4d9535ed4833d8cccadf571953e0c4976..164df875a5ae78109149b1231bfc9849dafd6731 100644 (file)
@@ -1,7 +1,7 @@
 /**********************************************************************
  * plpython.c - python as a procedural language for PostgreSQL
  *
- *     $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.83 2006/06/25 00:18:24 momjian Exp $
+ *     $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.84 2006/07/06 01:55:51 momjian Exp $
  *
  *********************************************************************
  */
 /* Python uses #pragma to bring in a non-default libpython on VC++ if
  * _DEBUG is defined */
 #undef _DEBUG
+/* Also hide away errcode, since we load Python.h before postgres.h */
+#define errcode __vc_errcode
 #include <Python.h>
+#undef errcode
 #define _DEBUG
 #else
 #include <Python.h>
@@ -2360,7 +2363,7 @@ PLy_init_plpy(void)
 /* the python interface to the elog function
  * don't confuse these with PLy_elog
  */
-static PyObject *PLy_output(int, PyObject *, PyObject *);
+static PyObject *PLy_output(volatile int, PyObject *, PyObject *);
 
 static PyObject *
 PLy_debug(PyObject * self, PyObject * args)