]> 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>
Tue, 7 May 2024 16:57:27 +0000 (19:57 +0300)
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
src/liblzma/rangecoder/range_common.h

index bf08ce39d7e5922a898e5909eca33c9ecca6acf2..b48b6699dfc8069d80326d068d5d4667af40889e 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 2c74dc1537c8fa1c2fe86ca73f6c19f8315d479f..9d3cfe2ae951382f25e058412ea538e476205fd2 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
 
 
 ///////////////