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

From Gregory Stark
Subject Re: Problem with ControlFileData structure being ABI dependent
Date
Msg-id 87mysnpglm.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Problem with ControlFileData structure being ABI dependent  (Rainer Bauer <usenet@munnin.com>)
Responses Re: Problem with ControlFileData structure being ABI dependent  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Rainer Bauer" <usenet@munnin.com> writes:

> Gregory Stark wrote:
>
>>This is because of (at least) two changes in the ABI between the runtimes used
>>by mingw and VC++.
>> 1) Enums are apparently 8 bytes on VC++ but 4 bytes on mingw
>
> They are 4 bytes here on my 32 bit WinXP machine with VS2005SP1.

Oh, I bet it's not the enum which is 8 bytes but that the time_t required
8-byte alignment so there's 4 bytes of padding before it.

>> 2) time_t is 8 bytes on VC++ but 4 bytes on mingw.
>
> Not sure whether an 8 byte time_t is now required by postgres. But you can get
> the old behaviour by defining _USE_32BIT_TIME_T.

Ugh.

The immediate problem is that a database initialized with with MSVCC can't be
run under mingw and vice versa. That's not necessarily important but it does
seem like it would be nice.

The looming problem is that you won't be able to use any libraries or 3rd
party tools which use time_t in their interface unless you build with the same
size time_t as they do. I don't know how're expected to find out that a .so
you're handed has a different size time_t.

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


pgsql-hackers by date:

Previous
From: Rainer Bauer
Date:
Subject: Re: Problem with ControlFileData structure being ABI dependent
Next
From: Rainer Bauer
Date:
Subject: Re: Problem with ControlFileData structure being ABI dependent