]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Fix compilation of price_tablegen.c.
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 12 Feb 2024 15:09:10 +0000 (17:09 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 14 Feb 2024 16:31:16 +0000 (18:31 +0200)
It is built and run only manually so this didn't matter
unless one wanted to regenerate the price_table.c.

src/liblzma/rangecoder/price_tablegen.c
src/liblzma/rangecoder/range_common.h

index 94a3b1f1c4df9b7fd50b06ab267583b546ace1ab..3ab587ebcfdbeac24801ae6dbcfbd13ca31a0939 100644 (file)
 
 #include <inttypes.h>
 #include <stdio.h>
+
+// Make it compile without common.h.
+#define BUILDING_PRICE_TABLEGEN
+#define lzma_attr_visibility_hidden
+
 #include "range_common.h"
 #include "price.h"
 
index b72b7d46298d8cc498c4038f2938319fd6772519..bcfd966e6ba1c2bcbdba953a6d1baaee01a98c76 100644 (file)
 #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
 
 
 ///////////////