Attached patch OK?
From c189de0294c89cb87313748be5c5555e0aa8045e Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10wa...@gmail.com>
Date: Sun, 1 Nov 2020 02:22:39 +0000
Subject: [PATCH] stddef.h: sync max_align_t definition with newer gcc

Related to:
https://sourceforge.net/p/mingw-w64/bugs/778/
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973495

Signed-off-by: Jonathan Yong <10wa...@gmail.com>
---
 mingw-w64-headers/crt/stddef.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mingw-w64-headers/crt/stddef.h b/mingw-w64-headers/crt/stddef.h
index 03c8ebf8..15fc79c5 100644
--- a/mingw-w64-headers/crt/stddef.h
+++ b/mingw-w64-headers/crt/stddef.h
@@ -424,6 +424,15 @@ typedef __WCHAR_TYPE__ wchar_t;
 typedef struct {
   long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
   long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
+  /* _Float128 is defined as a basic type, so max_align_t must be
+     sufficiently aligned for it.  This code must work in C++, so we
+     use __float128 here; that is only available on some
+     architectures, but only on i386 is extra alignment needed for
+     __float128.  */
+/* compiler probably knows __float128 if __SIZEOF_FLOAT128__ is defined */
+#if defined(__i386__) && defined (__SIZEOF_FLOAT128__)
+  __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128))));
+#endif
 } max_align_t;
 #endif
 #endif /* C11 or C++11.  */
-- 
2.29.2

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to