From f6baaa2102a8693d705ba0d4f1f5305058762a02 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Tue, 11 Apr 2017 10:27:33 +0300 Subject: [PATCH] Fix linking due to clashing xxhash defines between LZ and Zstd. Probably would be better to use XXH_PRIVATE_API instead, but that requires xxhash.c to have that exact name without prefixes. --- C/lz4/lz4frame.c | 1 + C/lz4/lz4xxhash.c | 1 + C/lz5/lz5frame.c | 1 + C/lz5/lz5xxhash.c | 1 + 4 files changed, 4 insertions(+) diff --git a/C/lz4/lz4frame.c b/C/lz4/lz4frame.c index a0a625b0..08588318 100644 --- a/C/lz4/lz4frame.c +++ b/C/lz4/lz4frame.c @@ -63,6 +63,7 @@ You can contact the author at : #include "lz4.h" #include "lz4hc.h" #define XXH_STATIC_LINKING_ONLY +#define XXH_NAMESPACE lz #include "xxhash.h" diff --git a/C/lz4/lz4xxhash.c b/C/lz4/lz4xxhash.c index e9ff2d42..bc9f61ef 100644 --- a/C/lz4/lz4xxhash.c +++ b/C/lz4/lz4xxhash.c @@ -105,6 +105,7 @@ static void XXH_free (void* p) { free(p); } static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); } #define XXH_STATIC_LINKING_ONLY +#define XXH_NAMESPACE lz #include "xxhash.h" diff --git a/C/lz5/lz5frame.c b/C/lz5/lz5frame.c index f6e4773b..138ee29a 100644 --- a/C/lz5/lz5frame.c +++ b/C/lz5/lz5frame.c @@ -63,6 +63,7 @@ You can contact the author at : #include "lz5frame_static.h" #include "lz5.h" #include "lz5hc.h" +#define XXH_NAMESPACE lz #include "xxhash.h" diff --git a/C/lz5/lz5xxhash.c b/C/lz5/lz5xxhash.c index 511d9941..3ca630ce 100644 --- a/C/lz5/lz5xxhash.c +++ b/C/lz5/lz5xxhash.c @@ -106,6 +106,7 @@ You can contact the author at : /************************************** * Includes & Memory related functions ***************************************/ +#define XXH_NAMESPACE lz #include "xxhash.h" /* Modify the local functions below should you wish to use some other memory routines */ /* for malloc(), free() */