Re: Building Windows Server Extensions Using VC++ 2005 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Building Windows Server Extensions Using VC++ 2005
Date
Msg-id 21766.1141493380@sss.pgh.pa.us
Whole thread Raw
In response to Re: Building Windows Server Extensions Using VC++ 2005  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> Well that sort of stuff is supposed to be covered by the ABI. Consider that if
> it didn't then you wouldn't be able to use any of the standard libraries
> without recompiling them for each compiler since a number of standard library
> APIs depend on structs like timeval or stat.

Maybe.  My experience with these sorts of problems is fairly old (hard
lessons from libjpeg development in the mid-90s), but what I learned at
the time is that all the standard Unix library interfaces are carefully
designed to be fairly impervious to struct padding rules (eg, all the
fields are "int", or at least all the same size), and so you can get
apparent interoperability between compilers that don't agree on these
rules.  Meanwhile, Microsoft, who never met a feature they didn't like,
invented a foot-gun called #pragma pack, and then had to fix all their
headers to nail down the pack setting.  That in turn masks compatibility
issues on that platform, but only if you're willing to #pragma-ify all
of your own headers too.

In short, I don't trust anybody on this issue.  I have the scars to
remind me why not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: problem with large maintenance_work_mem settings and
Next
From: Charlie Savage
Date:
Subject: Re: Building Windows Server Extensions Using VC++ 2005