Re: windows consolidated cleanup

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: windows consolidated cleanup
Date: 2011-04-24 23:31:53
Message-ID: 1303687913.5006.16.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On sön, 2011-04-24 at 12:25 -0400, Tom Lane wrote:
> This file is in fundamental violation of the first commandment of
> Postgres #includes, which is "thou shalt have no other gods before c.h".
> We need to put postgres.h *before* the Python.h include. I don't know
> what issues led to the current arrangement but it is fraught with
> portability gotchas. In particular it's just about guaranteed to fail
> on platforms where <stdio.h> reacts to _FILE_OFFSET_BITS --- plpython.c
> is going to get compiled expecting a different stdio library than the
> rest of the backend.

Here is where this happened:

commit ab6ee1f9fc7039b1e8d8ebf939da3fd55e73efad
Author: Joe Conway <mail(at)joeconway(dot)com>
Date: Thu Aug 5 03:10:29 2004 +0000

Move include for Python.h above postgres.h to eliminate compiler warning.

diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 76ea031..07eed86 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -29,11 +29,12 @@
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.52 2004/08/04 21:34:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.53 2004/08/05 03:10:29 joe Exp $
*
*********************************************************************
*/

+#include <Python.h>
#include "postgres.h"

/* system stuff */
@@ -54,7 +55,6 @@
#include "utils/syscache.h"
#include "utils/typcache.h"

-#include <Python.h>
#include <compile.h>
#include <eval.h>

If you switch it back around, you indeed get a bunch of annoying
warnings. This will need some playing around it get right.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-04-24 23:56:47 Re: Collation patch's handling of wcstombs/mbstowcs is sheerest fantasy
Previous Message Peter Eisentraut 2011-04-24 23:18:18 make check in contrib