mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Fixed alignment issue with GCC/Clang i386 build
This commit is contained in:
parent
d5edd3db36
commit
4c1e03ebff
1 changed files with 9 additions and 0 deletions
|
@ -780,6 +780,15 @@ PFloat::PFloat(unsigned int size)
|
||||||
mDescriptiveName.Format("Float%d", size);
|
mDescriptiveName.Format("Float%d", size);
|
||||||
if (size == 8)
|
if (size == 8)
|
||||||
{
|
{
|
||||||
|
#ifdef __i386__
|
||||||
|
// According to System V i386 ABI alignment of double type is 4
|
||||||
|
// GCC and Clang for 32-bit Intel targets follow this requirement
|
||||||
|
// However GCC has -malign-double option to enable 8-byte alignment
|
||||||
|
// So calculation of the actual alignment is needed
|
||||||
|
struct AlignmentCheck { uint8_t i; double d; };
|
||||||
|
Align = static_cast<unsigned int>(offsetof(AlignmentCheck, d));
|
||||||
|
#endif // __i386__
|
||||||
|
|
||||||
SetDoubleSymbols();
|
SetDoubleSymbols();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue