From 6c118e128a88232676f886514d42ccd2c952181f Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 24 Sep 2024 17:17:35 -0700 Subject: [PATCH] Fix for issue with `wc_HashAlg` being a union. --- wolfssl/wolfcrypt/hash.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wolfssl/wolfcrypt/hash.h b/wolfssl/wolfcrypt/hash.h index 5c1a6d661a..5738842133 100644 --- a/wolfssl/wolfcrypt/hash.h +++ b/wolfssl/wolfcrypt/hash.h @@ -94,7 +94,10 @@ enum wc_HashFlags { }; #ifndef NO_HASH_WRAPPER -typedef union { +typedef struct { +#if HAVE_ANONYMOUS_INLINE_AGGREGATES + union { +#endif #ifndef NO_MD5 wc_Md5 md5; #endif @@ -119,6 +122,9 @@ typedef union { #ifdef WOLFSSL_SM3 wc_Sm3 sm3; #endif +#if HAVE_ANONYMOUS_INLINE_AGGREGATES + }; +#endif unsigned int isAllocated:1; /* flag indicates if structure was allocated */ } wc_HashAlg; #endif /* !NO_HASH_WRAPPER */