Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4f4d62a

Browse files
committed
Attached patch is required ot build with the CRT that comes with Visual
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
1 parent a77275f commit 4f4d62a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/include/c.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/include/c.h,v 1.205 2006/06/26 23:53:14 momjian Exp $
15+
* $PostgreSQL: pgsql/src/include/c.h,v 1.206 2006/07/06 01:55:51 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -59,6 +59,9 @@
5959

6060
#if defined(_MSC_VER) || defined(__BORLANDC__)
6161
#define WIN32_ONLY_COMPILER
62+
#define errcode __vc_errcode
63+
#include <crtdefs.h>
64+
#undef errcode
6265
#endif
6366

6467
#include <stdio.h>

src/pl/plpython/plpython.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
* plpython.c - python as a procedural language for PostgreSQL
33
*
4-
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.83 2006/06/25 00:18:24 momjian Exp $
4+
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.84 2006/07/06 01:55:51 momjian Exp $
55
*
66
*********************************************************************
77
*/
@@ -10,7 +10,10 @@
1010
/* Python uses #pragma to bring in a non-default libpython on VC++ if
1111
* _DEBUG is defined */
1212
#undef _DEBUG
13+
/* Also hide away errcode, since we load Python.h before postgres.h */
14+
#define errcode __vc_errcode
1315
#include <Python.h>
16+
#undef errcode
1417
#define _DEBUG
1518
#else
1619
#include <Python.h>
@@ -2360,7 +2363,7 @@ PLy_init_plpy(void)
23602363
/* the python interface to the elog function
23612364
* don't confuse these with PLy_elog
23622365
*/
2363-
static PyObject *PLy_output(int, PyObject *, PyObject *);
2366+
static PyObject *PLy_output(volatile int, PyObject *, PyObject *);
23642367

23652368
static PyObject *
23662369
PLy_debug(PyObject * self, PyObject * args)

0 commit comments

Comments
 (0)