From 4f6c8ef2ac4fdaf4e77d443623c58f0c28837b66 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Fri, 9 Jan 2026 08:45:23 -0500 Subject: [PATCH] fix error in GCC bswap Signed-off-by: Dave Rodgman --- library/alignment.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/alignment.h b/library/alignment.h index 3c107d8695..d304133382 100644 --- a/library/alignment.h +++ b/library/alignment.h @@ -280,15 +280,15 @@ static inline void mbedtls_put_unaligned_uint64(void *p, uint64_t x) /* * Detect GCC built-in byteswap routines */ -#if defined(__GNUC__) && defined(__GNUC_PREREQ) -#if __GNUC_PREREQ(4, 8) +#if defined(__GNUC__) +#if MBEDTLS_GCC_VERSION >= 40800 #define MBEDTLS_BSWAP16 __builtin_bswap16 -#endif /* __GNUC_PREREQ(4,8) */ -#if __GNUC_PREREQ(4, 3) +#endif +#if MBEDTLS_GCC_VERSION >= 40300 #define MBEDTLS_BSWAP32 __builtin_bswap32 #define MBEDTLS_BSWAP64 __builtin_bswap64 -#endif /* __GNUC_PREREQ(4,3) */ -#endif /* defined(__GNUC__) && defined(__GNUC_PREREQ) */ +#endif +#endif /* defined(__GNUC__) */ /* * Detect Clang built-in byteswap routines