From d5c6c79a76189a6f55ecbb66949193a1640c248c Mon Sep 17 00:00:00 2001 From: Patedam Date: Sat, 24 Oct 2026 17:16:41 -0400 Subject: [PATCH] adding xxhash --- .gitmodules | 4 ++-- Juliet/core/core_hash.c | 14 ++++++++++++-- Juliet/external/xxHash | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) create mode 160000 Juliet/external/xxHash diff --git a/.gitmodules b/.gitmodules index b0d954e..8e8257e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,6 @@ [submodule "Juliet/external/stb"] path = Juliet/external/stb url = https://github.com/nothings/stb.git -[submodule "Juliet/external/xxhash"] - path = Juliet/external/xxhash +[submodule "Juliet/external/xxHash"] + path = Juliet/external/xxHash url = https://github.com/Cyan4973/xxHash.git diff --git a/Juliet/core/core_hash.c b/Juliet/core/core_hash.c index 3b64e5a..767f96e 100644 --- a/Juliet/core/core_hash.c +++ b/Juliet/core/core_hash.c @@ -1,11 +1,21 @@ // ============================================================================= // Hash Functions -#define HASH_STRING 4259 +#pragma push_macro("__cpuid") +#undef __cpuid +#if !defined(XXH_IMPLEMENTATION) +# define XXH_INLINE_ALL +# define XXH_IMPLEMENTATION +# define XXH_STATIC_LINKING_ONLY +# include "external/xxHash/xxhash.h" +#endif +#pragma pop_macro("__cpuid") + +#define HASH_SEED 4259 internal uint64 uint64_hash_from_string(String8 string) { - uint64 result = uint64_hash_from_seed_string(HASH_STRING, string); + uint64 result = uint64_hash_from_seed_string(HASH_SEED, string); return result; } diff --git a/Juliet/external/xxHash b/Juliet/external/xxHash new file mode 160000 index 0000000..d9dfb82 --- /dev/null +++ b/Juliet/external/xxHash @@ -0,0 +1 @@ +Subproject commit d9dfb8203cd67c576f1d46965ef5c0e48582196d