Re: Problem with ControlFileData structure being ABI depe ndent - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Problem with ControlFileData structure being ABI depe ndent
Date
Msg-id 877ijqprdj.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Problem with ControlFileData structure being ABI depe ndent  ("Magnus Hagander" <magnus@hagander.net>)
Responses Re: Problem with ControlFileData structure being ABI depe ndent  (Dave Page <dpage@postgresql.org>)
List pgsql-hackers
"Magnus Hagander" <magnus@hagander.net> writes:

>> > I guess my advice would be to see if we can define _USE_32BIT_TIME_T
>> > in port/win32.h and make it go away that way.  It'd definitely be nice
>> > if MSVC and Mingw builds weren't binary-incompatible.
>> 
>> The attached patch defines it in the MSVC project files along with the
>> other API-config related macros. It fixes all the offsets so they match
>> mingw, but the CRC is still different for some as-yet unknown reason...
>
> Is the project file really the proper place? Consider an add-on module -
> wouldn't we want the setting to go in that one as well? meaning we'd have it in
> a header file instead?

For an add-on module which is actually using time_t to interface with Postgres
it had better define _USE_... itself or else it risks having some files use
them and some not.

An alternative is leaving it in the project file but putting something like
this in c.h:

#ifdef WIN32
#ifndef _USE_32BIT_TIME_T
#error "Postgres uses 32 bit time_t add #define _USE_32BIT_TIME_T on Windows
#endif
#endif

For modules which *do* use time_t this is safer. However for modules which
don't use time_t it'll be an unnecessary hassle.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


pgsql-hackers by date:

Previous
From: Hubert FONGARNAND
Date:
Subject: Re: pg_dump and BINARY mode COPY
Next
From: Dave Page
Date:
Subject: Re: Problem with ControlFileData structure being ABI depe ndent