aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/simple/simple_private.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2016-11-21 20:24:50 +0200
committerLasse Collin <lasse.collin@tukaani.org>2016-12-28 19:59:32 +0200
commite013a337d3de77cce24360dffe956ea2339489b6 (patch)
tree3a0311088554a21f4cb19d98700e0f7b076a612a /src/liblzma/simple/simple_private.h
parentDocument --enable-sandbox configure option in INSTALL. (diff)
downloadxz-e013a337d3de77cce24360dffe956ea2339489b6.tar.xz
liblzma: Avoid multiple definitions of lzma_coder structures.
Only one definition was visible in a translation unit. It avoided a few casts and temp variables but seems that this hack doesn't work with link-time optimizations in compilers as it's not C99/C11 compliant. Fixes: http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html
Diffstat (limited to 'src/liblzma/simple/simple_private.h')
-rw-r--r--src/liblzma/simple/simple_private.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/liblzma/simple/simple_private.h b/src/liblzma/simple/simple_private.h
index bb20cb41..9d2c0fdd 100644
--- a/src/liblzma/simple/simple_private.h
+++ b/src/liblzma/simple/simple_private.h
@@ -16,9 +16,7 @@
#include "simple_coder.h"
-typedef struct lzma_simple_s lzma_simple;
-
-struct lzma_coder_s {
+typedef struct {
/// Next filter in the chain
lzma_next_coder next;
@@ -33,12 +31,12 @@ struct lzma_coder_s {
/// Pointer to filter-specific function, which does
/// the actual filtering.
- size_t (*filter)(lzma_simple *simple, uint32_t now_pos,
+ size_t (*filter)(void *simple, uint32_t now_pos,
bool is_encoder, uint8_t *buffer, size_t size);
/// Pointer to filter-specific data, or NULL if filter doesn't need
/// any extra data.
- lzma_simple *simple;
+ void *simple;
/// The lowest 32 bits of the current position in the data. Most
/// filters need this to do conversions between absolute and relative
@@ -62,13 +60,13 @@ struct lzma_coder_s {
/// Temporary buffer
uint8_t buffer[];
-};
+} lzma_simple_coder;
extern lzma_ret lzma_simple_coder_init(lzma_next_coder *next,
const lzma_allocator *allocator,
const lzma_filter_info *filters,
- size_t (*filter)(lzma_simple *simple, uint32_t now_pos,
+ size_t (*filter)(void *simple, uint32_t now_pos,
bool is_encoder, uint8_t *buffer, size_t size),
size_t simple_size, size_t unfiltered_max,
uint32_t alignment, bool is_encoder);