From a4eb23205a7723917fc26e778dd2ab65d8aa9e84 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Tue, 24 Mar 2026 09:37:09 +0100 Subject: [PATCH] Fix igc_header for Mingw64 * src/igc-types.h (union igc_header): Use uint32_t instead for size_t. Apparently needed for Mingw64; with size_t the header grows to 16 bytes. * src/igc.c: Move static assert to igc-types.h. --- src/igc-types.h | 11 +++++++---- src/igc.c | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/igc-types.h b/src/igc-types.h index 681322388ed..f5327c38783 100644 --- a/src/igc-types.h +++ b/src/igc-types.h @@ -96,15 +96,15 @@ union igc_header { enum igc_tag tag : IGC_HEADER_TAG_BITS; enum igc_obj_type obj_type : IGC_HEADER_TYPE_BITS; - size_t hash : IGC_HEADER_HASH_BITS; - size_t nwords : IGC_HEADER_NWORDS_BITS; + uint32_t hash : IGC_HEADER_HASH_BITS; + uint32_t nwords : IGC_HEADER_NWORDS_BITS; } s; #endif #ifdef WORDS_BIGENDIAN struct { - size_t nwords : IGC_HEADER_NWORDS_BITS; - size_t hash : IGC_HEADER_HASH_BITS; + uint32_t nwords : IGC_HEADER_NWORDS_BITS; + uint32_t hash : IGC_HEADER_HASH_BITS; enum igc_obj_type obj_type : IGC_HEADER_TYPE_BITS; enum igc_tag tag : IGC_HEADER_TAG_BITS; } s; @@ -113,4 +113,7 @@ union igc_header GCALIGNED_UNION_MEMBER }; +static_assert (sizeof (*(union igc_header*) 0).s == 8); +static_assert (sizeof (union igc_header) == 8); + #endif /* EMACS_IGC_TYPES_H */ diff --git a/src/igc.c b/src/igc.c index a10209da70f..a0c7c3bb37f 100644 --- a/src/igc.c +++ b/src/igc.c @@ -663,8 +663,6 @@ struct igc_fwd mps_addr_t new_addr; }; -static_assert (sizeof (union igc_header) == 8); - static void check_header_bit (union igc_header h1, size_t i, size_t shift) {