From fda91a5d77202fa377b053ca533e44b8ff8bfa3e Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Mon, 12 Feb 2024 17:09:10 +0200 Subject: [PATCH] liblzma: Fix compilation of price_tablegen.c. It is built and run only manually so this didn't matter unless one wanted to regenerate the price_table.c. (cherry picked from commit 8e4ec794836bc1701d8c9bd5e347b8ce8cc5bbb4) (cherry picked from commit 65b5ee071697e4fe4c2a31c14c1d68b727f1654c) --- src/liblzma/rangecoder/price_tablegen.c | 5 +++++ src/liblzma/rangecoder/range_common.h | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/liblzma/rangecoder/price_tablegen.c b/src/liblzma/rangecoder/price_tablegen.c index bf08ce39..b48b6699 100644 --- a/src/liblzma/rangecoder/price_tablegen.c +++ b/src/liblzma/rangecoder/price_tablegen.c @@ -15,6 +15,11 @@ #include #include + +// Make it compile without common.h. +#define BUILDING_PRICE_TABLEGEN +#define lzma_attr_visibility_hidden + #include "range_common.h" #include "price.h" diff --git a/src/liblzma/rangecoder/range_common.h b/src/liblzma/rangecoder/range_common.h index 2c74dc15..9d3cfe2a 100644 --- a/src/liblzma/rangecoder/range_common.h +++ b/src/liblzma/rangecoder/range_common.h @@ -14,7 +14,10 @@ #ifndef LZMA_RANGE_COMMON_H #define LZMA_RANGE_COMMON_H -#include "common.h" +// Skip common.h if building price_tablegen.c. +#ifndef BUILDING_PRICE_TABLEGEN +# include "common.h" +#endif ///////////////