]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added __clang__ to compiler-specific alignment attribute 4286/head
authorYann Collet <cyan@fb.com>
Wed, 5 Feb 2025 21:48:24 +0000 (13:48 -0800)
committerYann Collet <cyan@fb.com>
Wed, 5 Feb 2025 21:48:24 +0000 (13:48 -0800)
when clang is used within msvc, `__GNUC__` isn't defined,
so testing `__clang__` explicitly is required.

lib/common/compiler.h

index 66792463b912c44bd487d2db54ff2bdf7f7be87d..1f7da50e6da9fb6269cb56550a12271938759dc1 100644 (file)
@@ -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)