From f324f42c4e8130f6452b2eb169db23f6ce244d84 Mon Sep 17 00:00:00 2001 From: brian khuu Date: Fri, 28 Jun 2024 00:12:11 +1000 Subject: [PATCH] gguf-hash: missing stdalign.h in windows bypass --- examples/gguf-hash/deps/xxhash/xxhash.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/gguf-hash/deps/xxhash/xxhash.h b/examples/gguf-hash/deps/xxhash/xxhash.h index 0f0e1900d..599fea292 100644 --- a/examples/gguf-hash/deps/xxhash/xxhash.h +++ b/examples/gguf-hash/deps/xxhash/xxhash.h @@ -1687,7 +1687,11 @@ struct XXH64_state_s { #ifndef XXH_NO_XXH3 -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */ +/* Windows SDK under 10.0.22000 check is missing stdalign.h so we add a check + before allowing the windows compiler to use the C11 form. + Reference: https://github.com/Cyan4973/xxHash/issues/955 */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) \ + && (defined(_MSC_VER) && (_MSC_VER >= 1000) || !defined(_MSC_VER)) /* >= C11 */ # include # define XXH_ALIGN(n) alignas(n) #elif defined(__cplusplus) && (__cplusplus >= 201103L) /* >= C++11 */