Skip to content

Commit

Permalink
Merge pull request #4286 from facebook/visual_clang_avx2
Browse files Browse the repository at this point in the history
Fix Visual + ClangCL + AVX2 compilation
  • Loading branch information
Cyan4973 authored Feb 5, 2025
2 parents 26a2b5d + 54e9d46 commit 8156a19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dev-short-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ jobs:
- generator: "MinGW Makefiles"
- generator: "Visual Studio 17 2022"
flags: "-T ClangCL"
- generator: "Visual Studio 17 2022"
flags: "-T ClangCL -A x64 -DCMAKE_C_FLAGS=/arch:AVX2"
runs-on: windows-2022
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
Expand Down
4 changes: 2 additions & 2 deletions lib/common/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ 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)
# define ZSTD_ALIGNED(a) _Alignas(a)
#elif defined(_MSC_VER)
# define ZSTD_ALIGNED(n) __declspec(align(n))
# else
Expand Down

0 comments on commit 8156a19

Please sign in to comment.