aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/index.h
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-01-05 20:57:25 +0800
committerLasse Collin <lasse.collin@tukaani.org>2023-01-09 16:37:19 +0200
commit692ccdf5516dfe55fb6e9c5cdfb31f4c02c1ecd1 (patch)
tree6b1499996b9f1e99db43c95adc4b972f649443f0 /src/liblzma/common/index.h
parentliblzma: Add NULL check to lzma_index_hash_append. (diff)
downloadxz-692ccdf5516dfe55fb6e9c5cdfb31f4c02c1ecd1.tar.xz
liblzma: Remove common.h include from common/index.h.
common/index.h is needed by liblzma internally and tests. common.h will include and define many things that are not needed by the tests. Also, this prevents include order problems because both common.h and lzma.h define LZMA_API. On most platforms it results only in a warning but on Windows it would break the build as the definition in common.h must be used only for building liblzma itself.
Diffstat (limited to '')
-rw-r--r--src/liblzma/common/index.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/liblzma/common/index.h b/src/liblzma/common/index.h
index ea396714..031efcc7 100644
--- a/src/liblzma/common/index.h
+++ b/src/liblzma/common/index.h
@@ -2,6 +2,13 @@
//
/// \file index.h
/// \brief Handling of Index
+/// \note This header file does not include common.h or lzma.h because
+/// this file is needed by both liblzma internally and by the
+/// tests. Including common.h will include and define many things
+/// the tests do not need and prevents issues with header file
+/// include order. This way, if lzma.h or common.h are not
+/// included before this file it will break on every OS instead
+/// of causing more subtle errors.
//
// Author: Lasse Collin
//
@@ -13,8 +20,6 @@
#ifndef LZMA_INDEX_H
#define LZMA_INDEX_H
-#include "common.h"
-
/// Minimum Unpadded Size
#define UNPADDED_SIZE_MIN LZMA_VLI_C(5)