aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2024-02-12 17:09:10 +0200
committerLasse Collin <lasse.collin@tukaani.org>2024-02-14 18:31:16 +0200
commit8e4ec794836bc1701d8c9bd5e347b8ce8cc5bbb4 (patch)
tree27b8fdc5cf0a02d8f0d4a8045709b4060178e1e6 /src
parentAdd SPDX license identifiers to GPL, LGPL, and FSFULLR files. (diff)
downloadxz-8e4ec794836bc1701d8c9bd5e347b8ce8cc5bbb4.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/rangecoder/price_tablegen.c5
-rw-r--r--src/liblzma/rangecoder/range_common.h5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/liblzma/rangecoder/price_tablegen.c b/src/liblzma/rangecoder/price_tablegen.c
index 94a3b1f1..3ab587eb 100644
--- a/src/liblzma/rangecoder/price_tablegen.c
+++ b/src/liblzma/rangecoder/price_tablegen.c
@@ -14,6 +14,11 @@
#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"
diff --git a/src/liblzma/rangecoder/range_common.h b/src/liblzma/rangecoder/range_common.h
index b72b7d46..bcfd966e 100644
--- a/src/liblzma/rangecoder/range_common.h
+++ b/src/liblzma/rangecoder/range_common.h
@@ -13,7 +13,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
///////////////