ginclude: Exclude `__float128` from `max_align_t` for MinGW targets
GCC's stddef.h now excludes `__float128` from `max_align_t` for MinGW targets to align with Microsoft CRT and mingw-w64 headers.
For MinGW targets on 32-bit x86 systems, __float128 is now excluded from max_align_t. This change aligns GCC’s behavior with the Microsoft C runtime, which provides 8-byte alignment for malloc and defines max_align_t as double, and also matches the behavior of mingw-w64 headers.
In Details
This patch modifies ginclude/stddef.h to conditionally exclude the __float128 type from the definition of max_align_t when targeting MinGW on 32-bit x86 architectures. This adjustment is made to conform to the alignment guarantees provided by the Microsoft C runtime library (CRT) and the behavior of the mingw-w64 headers. The Microsoft CRT's malloc function guarantees only 8-byte alignment, and its max_align_t is typically double, whereas __float128 (if available and used) might require greater alignment, potentially leading to issues if max_align_t were to include it.
- MinGW
- Minimalist GNU for Windows. It's a development environment that allows Windows applications to be built using the GNU Compiler Collection (GCC).
- __float128
- A GCC extension providing quadruple-precision floating-point support, typically using 128 bits. It often requires specific hardware or software support for its operations and alignment.
- max_align_t
- A C standard type defined in
<stddef.h>. It's an integral type capable of holding the maximum alignment requirement of any fundamental data type. The compiler uses this to ensure structures and members within them are properly aligned. - Microsoft C runtime
- The standard library provided by Microsoft for C and C++ development on Windows. It includes functions for input/output, memory management, and other system services.
- alignment
- The requirement that data in memory be placed at addresses that are multiples of a specific value (e.g., 2, 4, 8, 16 bytes). Proper alignment is crucial for performance and correctness on many architectures, as unaligned accesses can be slow or cause exceptions.