فهرست منبع

MIPS: math-emu: Work around limitations of older GCC.

Older GCC doesn't get named initializations of anonymous structs right,
that is members are not initializable in the containing structure through
name however old style initializations are working fine.

The issue exists with gcc up to 4.5.x.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Ralf Baechle 11 سال پیش
والد
کامیت
91496ea9f8
1فایلهای تغییر یافته به همراه15 افزوده شده و 3 حذف شده
  1. 15 3
      arch/mips/math-emu/ieee754.c

+ 15 - 3
arch/mips/math-emu/ieee754.c

@@ -34,11 +34,17 @@
  * Special constants
  * Special constants
  */
  */
 
 
+/*
+ * Older GCC requires the inner braces for initialization of union ieee754dp's
+ * anonymous struct member.  Without an error will result.
+ */
 #define DPCNST(s, b, m)							\
 #define DPCNST(s, b, m)							\
 {									\
 {									\
-	.sign	= (s),							\
-	.bexp	= (b) + DP_EBIAS,					\
-	.mant	= (m)							\
+	{								\
+		.sign	= (s),						\
+		.bexp	= (b) + DP_EBIAS,				\
+		.mant	= (m)						\
+	}								\
 }
 }
 
 
 const union ieee754dp __ieee754dp_spcvals[] = {
 const union ieee754dp __ieee754dp_spcvals[] = {
@@ -61,11 +67,17 @@ const union ieee754dp __ieee754dp_spcvals[] = {
 	DPCNST(0, 63,          0x0000000000000ULL),	/* + 1.0e63 */
 	DPCNST(0, 63,          0x0000000000000ULL),	/* + 1.0e63 */
 };
 };
 
 
+/*
+ * Older GCC requires the inner braces for initialization of union ieee754sp's
+ * anonymous struct member.  Without an error will result.
+ */
 #define SPCNST(s, b, m)							\
 #define SPCNST(s, b, m)							\
 {									\
 {									\
+	{								\
 	.sign	= (s),							\
 	.sign	= (s),							\
 	.bexp	= (b) + SP_EBIAS,					\
 	.bexp	= (b) + SP_EBIAS,					\
 	.mant	= (m)							\
 	.mant	= (m)							\
+	}								\
 }
 }
 
 
 const union ieee754sp __ieee754sp_spcvals[] = {
 const union ieee754sp __ieee754sp_spcvals[] = {