From f8a92529ec04b560b5b9e647b976892412f78134 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 5 Sep 2019 19:08:10 +0200 Subject: Fix API visibility for libsquashfs.so This commit adds a "predef.h" header to libsquashfs that exposes two macros, SQFS_API and SQFS_INTERNAL that are used to explicilty set the visibiliy of stuff that ends up in libsquashfs to default or hidden. For compatibillity with Windows which may at some point eventually be considered, the SQFS_API define is set to dllexport IF the cpp symbol SQFS_BUILDING_DLL is defined and set to import otherwise. Signed-off-by: David Oberhollenzer --- lib/sqfs/comp/compressor.c | 1 + lib/sqfs/comp/gzip.c | 1 + lib/sqfs/comp/internal.h | 8 ++++++++ lib/sqfs/comp/lz4.c | 1 + lib/sqfs/comp/lzo.c | 1 + lib/sqfs/comp/xz.c | 1 + lib/sqfs/comp/zstd.c | 1 + 7 files changed, 14 insertions(+) (limited to 'lib/sqfs/comp') diff --git a/lib/sqfs/comp/compressor.c b/lib/sqfs/comp/compressor.c index fef238a..005dbd4 100644 --- a/lib/sqfs/comp/compressor.c +++ b/lib/sqfs/comp/compressor.c @@ -4,6 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ +#define SQFS_BUILDING_DLL #include "config.h" #include diff --git a/lib/sqfs/comp/gzip.c b/lib/sqfs/comp/gzip.c index 39e101f..e80073d 100644 --- a/lib/sqfs/comp/gzip.c +++ b/lib/sqfs/comp/gzip.c @@ -4,6 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ +#define SQFS_BUILDING_DLL #include "config.h" #include diff --git a/lib/sqfs/comp/internal.h b/lib/sqfs/comp/internal.h index 1f76a45..117bb82 100644 --- a/lib/sqfs/comp/internal.h +++ b/lib/sqfs/comp/internal.h @@ -9,21 +9,29 @@ #include "config.h" +#include "sqfs/predef.h" #include "sqfs/compress.h" #include "util.h" +SQFS_INTERNAL int sqfs_generic_write_options(int fd, const void *data, size_t size); +SQFS_INTERNAL int sqfs_generic_read_options(int fd, void *data, size_t size); +SQFS_INTERNAL sqfs_compressor_t *xz_compressor_create(const sqfs_compressor_config_t *cfg); +SQFS_INTERNAL sqfs_compressor_t *gzip_compressor_create(const sqfs_compressor_config_t *cfg); +SQFS_INTERNAL sqfs_compressor_t *lzo_compressor_create(const sqfs_compressor_config_t *cfg); +SQFS_INTERNAL sqfs_compressor_t *lz4_compressor_create(const sqfs_compressor_config_t *cfg); +SQFS_INTERNAL sqfs_compressor_t *zstd_compressor_create(const sqfs_compressor_config_t *cfg); #endif /* INTERNAL_H */ diff --git a/lib/sqfs/comp/lz4.c b/lib/sqfs/comp/lz4.c index ddfab5c..0893b34 100644 --- a/lib/sqfs/comp/lz4.c +++ b/lib/sqfs/comp/lz4.c @@ -4,6 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ +#define SQFS_BUILDING_DLL #include "config.h" #include diff --git a/lib/sqfs/comp/lzo.c b/lib/sqfs/comp/lzo.c index 8512dfa..b01bf20 100644 --- a/lib/sqfs/comp/lzo.c +++ b/lib/sqfs/comp/lzo.c @@ -4,6 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ +#define SQFS_BUILDING_DLL #include "config.h" #include diff --git a/lib/sqfs/comp/xz.c b/lib/sqfs/comp/xz.c index 6598de7..1f98a25 100644 --- a/lib/sqfs/comp/xz.c +++ b/lib/sqfs/comp/xz.c @@ -4,6 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ +#define SQFS_BUILDING_DLL #include "config.h" #include diff --git a/lib/sqfs/comp/zstd.c b/lib/sqfs/comp/zstd.c index bd90207..8a1dbf3 100644 --- a/lib/sqfs/comp/zstd.c +++ b/lib/sqfs/comp/zstd.c @@ -4,6 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ +#define SQFS_BUILDING_DLL #include "config.h" #include -- cgit v1.2.3