From 54e9d46db44c4832d031100800f54a397358f896 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 5 Feb 2025 13:48:24 -0800 Subject: [PATCH] added __clang__ to compiler-specific alignment attribute when clang is used within msvc, `__GNUC__` isn't defined, so testing `__clang__` explicitly is required. --- lib/common/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 66792463b91..1f7da50e6da 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -302,7 +302,7 @@ MEM_STATIC int ZSTD_isPower2(size_t u) { #ifndef ZSTD_ALIGNED /* C90-compatible alignment macro (GCC/Clang). Adjust for other compilers if needed. */ -# if defined(__GNUC__) +# if defined(__GNUC__) || defined(__clang__) # define ZSTD_ALIGNED(a) __attribute__((aligned(a))) # elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */ # define ZSTD_ALIGNED(a) _Alignas(a)