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 common.h will redefine
LZMA_API resulting in a warning.
This commit is contained in:
Jia Tan 2023-01-05 20:57:25 +08:00
parent 064cd385a7
commit 84f9687cba
4 changed files with 10 additions and 2 deletions

View File

@ -10,6 +10,7 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "common.h"
#include "index.h" #include "index.h"
#include "stream_flags_common.h" #include "stream_flags_common.h"

View File

@ -2,6 +2,13 @@
// //
/// \file index.h /// \file index.h
/// \brief Handling of Index /// \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 // Author: Lasse Collin
// //
@ -13,8 +20,6 @@
#ifndef LZMA_INDEX_H #ifndef LZMA_INDEX_H
#define LZMA_INDEX_H #define LZMA_INDEX_H
#include "common.h"
/// Minimum Unpadded Size /// Minimum Unpadded Size
#define UNPADDED_SIZE_MIN LZMA_VLI_C(5) #define UNPADDED_SIZE_MIN LZMA_VLI_C(5)

View File

@ -13,6 +13,7 @@
#ifndef LZMA_INDEX_DECODER_H #ifndef LZMA_INDEX_DECODER_H
#define LZMA_INDEX_DECODER_H #define LZMA_INDEX_DECODER_H
#include "common.h"
#include "index.h" #include "index.h"

View File

@ -10,6 +10,7 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "common.h"
#include "index.h" #include "index.h"