Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2004-01-03 14:01:54


"Rob Williscroft" <rtw_at_[hidden]> wrote

> #if (defined __BORLANDC__) && (__BORLANDC__ <= 0x564)
> #pragma option -Ve // Enable EBO
> #include <pshpack1.h>
> #endif
>
> > class noncopyable
> > {
> > #if (defined __BORLANDC__) && (__BORLANDC__ <= 0x564)
> > char dummy; // BCB would use 8 bytes by default
> > #endif
> > protected:
> > ....
> };
>
> #if (defined __BORLANDC__) && (__BORLANDC__ <= 0x564)
> #include <poppack.h>
> #endif
>
>
Wow, that's what I was looking for! It is definitely better than dummy byte.

I tested it with BCB 6 patch 4. It works for multiple inheritance too.

AFAIK using <pophack1.h> requires patch #4 installed, with original BCB
version it screw up data alignement. (The patch is freely downloadable.)
This works without patch #4:

________________________

#if (defined __BORLANDC__) && (__BORLANDC__ <= 0x564)
# pragma option push -Ve // Enable EBO
# pragma pack(push, 1)
#endif
...
code
...
#if (defined __BORLANDC__) && (__BORLANDC__ <= 0x564)
# pragma pack(pop)
# pragma option pop
#endif
________________________

Thanks,
/Pavel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk