Boost logo

Boost Users :

From: Edward Diener (eddielee_at_[hidden])
Date: 2003-03-05 17:45:59


Russell Hind wrote:
>
> As mentioned in the rest of the thread by Edward Diener, bcc32
> supports #pragma option push and #pragma option pop to temporarily
> force compiler options, which as also mentioned, is how the headers
> that come with the compiler are configured so that the alignment for
> anything declared in there headers matches what was built into the
> .lib and therefore we can use our own compiler options for our code
> but not run into any problems with the pre-compiled libraries.
>
> Do you not think the same approach would work in boost? (I don't know
> how much support there is for push and pop of options in other
> compilers, though)

Microsoft has
#pragma pack(push,n)
#pragma pack(pop)

for packing and since all enum sizes are the same in VC++, that more or less
takes care of their data layout problems. I wouldn't be surprised if other
compilers also have appropriate #pragmas also, but VC++ and BCB are the only
ones in C++ I am currently using. Maybe a gcc expert knows something about
its technique, if any, to ensure data layout compatibility within the header
file itself.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net