From 455c6b4425138b2890b680d835a373a54e554109 Mon Sep 17 00:00:00 2001 From: Dan Aloni Date: Wed, 19 Feb 2020 17:54:45 +0200 Subject: [PATCH] Add LZ4_ prefix to lz4_sys's internal XXHASH symbols For users of lz4, this prevents possible linking collisions with other instances of XXHASH from other libraries in the executable. --- lz4-sys/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lz4-sys/build.rs b/lz4-sys/build.rs index bd591adaa..391c6d2f7 100644 --- a/lz4-sys/build.rs +++ b/lz4-sys/build.rs @@ -21,6 +21,7 @@ fn run() -> Result<(), Box> { .file("liblz4/lib/lz4frame.c") .file("liblz4/lib/lz4hc.c") .file("liblz4/lib/xxhash.c") + .define("XXH_NAMESPACE", "LZ4_") // We always compile the C with optimization, because otherwise it is 20x slower. .opt_level(3); match env::var("TARGET")