Re: python cleanup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: python cleanup
Date: 2011-07-25 03:46:33
Message-ID: 15870.1311565593@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On my Linux system the attached compiles without warnings. If this seems
> like the way to go I'll investigate more on Windows.

Hmm ...

> +/*
> + * Save settings the Python headers might override
> + */
> +#ifdef _POSIX_C_SOURCE
> +#define _PGSAVE_POSIX_C_SOURCE _POSIX_C_SOURCE
> +#undef _POSIX_C_SOURCE
> +#endif
> ...
> +/*
> + * Restore settings the Python headers might have overridden.
> + */
> +#ifdef _PGSAVE_POSIX_C_SOURCE
> +#undef _POSIX_C_SOURCE
> +#define _POSIX_C_SOURCE _PGSAVE_POSIX_C_SOURCE
> +#undef _PGSAVE_POSIX_C_SOURCE
> +#endif

I don't believe that this sequence will restore the contents of the
_POSIX_C_SOURCE macro to what it was before. For that matter, it's
not even quite right about ensuring that the macro's defined-ness
status is restored (what if the python headers set _POSIX_C_SOURCE
when it wasn't set before?). We might not need more than defined-ness
to be right, though.

What in the world are the python headers doing fooling with these
macros, anyway??

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tim 2011-07-25 04:23:22 Re: vacuumlo patch
Previous Message Alvaro Herrera 2011-07-25 02:12:36 Re: Policy on pulling in code from other projects?