Skip to content

Commit

Permalink
added __clang__ to compiler-specific alignment attribute
Browse files Browse the repository at this point in the history
when clang is used within msvc, `__GNUC__` isn't defined,
so testing `__clang__` explicitly is required.
  • Loading branch information
Cyan4973 committed Feb 5, 2025
1 parent bcf404c commit 54e9d46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/common/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 54e9d46

Please sign in to comment.