Re: python cleanup - Mailing list pgsql-hackers

From Tom Lane
Subject Re: python cleanup
Date
Msg-id 15870.1311565593@sss.pgh.pa.us
Whole thread Raw
In response to python cleanup  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: python cleanup
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Policy on pulling in code from other projects?
Next
From: Tim
Date:
Subject: Re: vacuumlo patch