===================================================================
@@ -64,7 +64,7 @@
union _FP_UNION_E
{
XFtype flt;
- struct
+ struct _FP_STRUCT_LAYOUT
{
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned long pad1 : _FP_W_TYPE_SIZE;
@@ -263,7 +263,7 @@
union _FP_UNION_E
{
XFtype flt;
- struct {
+ struct _FP_STRUCT_LAYOUT {
#if __BYTE_ORDER == __BIG_ENDIAN
_FP_W_TYPE pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
unsigned sign : 1;
===================================================================
@@ -58,7 +58,7 @@
union _FP_UNION_S
{
SFtype flt;
- struct {
+ struct _FP_STRUCT_LAYOUT {
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned sign : 1;
unsigned exp : _FP_EXPBITS_S;
===================================================================
@@ -68,7 +68,7 @@
union _FP_UNION_D
{
DFtype flt;
- struct {
+ struct _FP_STRUCT_LAYOUT {
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned sign : 1;
unsigned exp : _FP_EXPBITS_D;
@@ -167,7 +167,7 @@
union _FP_UNION_D
{
DFtype flt;
- struct {
+ struct _FP_STRUCT_LAYOUT {
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned sign : 1;
unsigned exp : _FP_EXPBITS_D;
===================================================================
@@ -67,7 +67,7 @@
union _FP_UNION_Q
{
TFtype flt;
- struct
+ struct _FP_STRUCT_LAYOUT
{
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned sign : 1;
@@ -171,10 +171,11 @@
union _FP_UNION_Q
{
TFtype flt /* __attribute__((mode(TF))) */ ;
- struct {
+ struct _FP_STRUCT_LAYOUT {
_FP_W_TYPE a, b;
} longs;
- struct {
+ struct _FP_STRUCT_LAYOUT
+ {
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned sign : 1;
unsigned exp : _FP_EXPBITS_Q;
===================================================================
@@ -85,6 +85,14 @@
#define FP_EX_DENORM 0
#endif
+/* For native windows targets struct-layout follows the ms-bitfields
+ layout. For unix-targets instead the gcc-struct-layout is used.
+ The difference between ms/gcc struct-layout is in consecutive bit-fields
+ with different declared types, which are getting packed different. */
+#ifndef _FP_STRUCT_LAYOUT
+#define _FP_STRUCT_LAYOUT
+#endif
+
#ifdef _FP_DECL_EX
#define FP_DECL_EX \
int _fex = 0; \