changed : dll : only approved ZSTD symbols are now exposed. All other symbols remain internal.
This commit is contained in:
+1
-1
@@ -70,7 +70,7 @@ libzstd.a: $(ZSTD_FILES)
|
|||||||
@$(CC) $(FLAGS) -c $^
|
@$(CC) $(FLAGS) -c $^
|
||||||
@$(AR) $(ARFLAGS) $@ *.o
|
@$(AR) $(ARFLAGS) $@ *.o
|
||||||
|
|
||||||
$(LIBZSTD): LDFLAGS += -shared -fPIC
|
$(LIBZSTD): LDFLAGS += -shared -fPIC -fvisibility=hidden
|
||||||
$(LIBZSTD): $(ZSTD_FILES)
|
$(LIBZSTD): $(ZSTD_FILES)
|
||||||
@echo compiling dynamic library $(LIBVER)
|
@echo compiling dynamic library $(LIBVER)
|
||||||
ifneq (,$(filter Windows%,$(OS)))
|
ifneq (,$(filter Windows%,$(OS)))
|
||||||
|
|||||||
+6
-14
@@ -27,20 +27,12 @@ extern "C" {
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#include <zstd.h> /* ZSTD_CStream, ZSTD_DStream */
|
#include <zstd.h> /* ZSTD_CStream, ZSTD_DStream, ZSTDLIB_API */
|
||||||
|
|
||||||
|
|
||||||
/* ***************************************************************
|
/* ***************************************************************
|
||||||
* Compiler specifics
|
* Compiler specifics
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
/* ZSTD_DLL_EXPORT :
|
|
||||||
* Enable exporting of functions when building a Windows DLL */
|
|
||||||
#if defined(_WIN32) && defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
|
|
||||||
# define ZSTDLIB_API __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define ZSTDLIB_API
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Deprecation warnings */
|
/* Deprecation warnings */
|
||||||
/* Should these warnings be a problem,
|
/* Should these warnings be a problem,
|
||||||
it is generally possible to disable them,
|
it is generally possible to disable them,
|
||||||
@@ -48,17 +40,17 @@ extern "C" {
|
|||||||
or _CRT_SECURE_NO_WARNINGS in Visual.
|
or _CRT_SECURE_NO_WARNINGS in Visual.
|
||||||
Otherwise, it's also possible to define ZBUFF_DISABLE_DEPRECATE_WARNINGS */
|
Otherwise, it's also possible to define ZBUFF_DISABLE_DEPRECATE_WARNINGS */
|
||||||
#ifdef ZBUFF_DISABLE_DEPRECATE_WARNINGS
|
#ifdef ZBUFF_DISABLE_DEPRECATE_WARNINGS
|
||||||
# define ZBUFF_DEPRECATED(message) /* disable deprecation warnings */
|
# define ZBUFF_DEPRECATED(message) ZSTDLIB_API /* disable deprecation warnings */
|
||||||
#else
|
#else
|
||||||
# if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__)
|
# if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__)
|
||||||
# define ZBUFF_DEPRECATED(message) __attribute__((deprecated(message)))
|
# define ZBUFF_DEPRECATED(message) ZSTDLIB_API __attribute__((deprecated(message)))
|
||||||
# elif defined(__GNUC__) && (__GNUC__ >= 3)
|
# elif defined(__GNUC__) && (__GNUC__ >= 3)
|
||||||
# define ZBUFF_DEPRECATED(message) __attribute__((deprecated))
|
# define ZBUFF_DEPRECATED(message) ZSTDLIB_API __attribute__((deprecated))
|
||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define ZBUFF_DEPRECATED(message) __declspec(deprecated(message))
|
# define ZBUFF_DEPRECATED(message) ZSTDLIB_API __declspec(deprecated(message))
|
||||||
# else
|
# else
|
||||||
# pragma message("WARNING: You need to implement ZBUFF_DEPRECATED for this compiler")
|
# pragma message("WARNING: You need to implement ZBUFF_DEPRECATED for this compiler")
|
||||||
# define ZBUFF_DEPRECATED(message)
|
# define ZBUFF_DEPRECATED(message) ZSTDLIB_API
|
||||||
# endif
|
# endif
|
||||||
#endif /* ZBUFF_DISABLE_DEPRECATE_WARNINGS */
|
#endif /* ZBUFF_DISABLE_DEPRECATE_WARNINGS */
|
||||||
|
|
||||||
|
|||||||
+4
-6
@@ -18,12 +18,10 @@ extern "C" {
|
|||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
|
|
||||||
|
|
||||||
/* ====== Export for Windows ======*/
|
/* ===== ZSTDLIB_API : control library symbols visibility ===== */
|
||||||
/*
|
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||||
* ZSTD_DLL_EXPORT :
|
# define ZSTDLIB_API __attribute__ ((visibility ("default")))
|
||||||
* Enable exporting of functions when building a Windows DLL
|
#elif defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
|
||||||
*/
|
|
||||||
#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
|
|
||||||
# define ZSTDLIB_API __declspec(dllexport)
|
# define ZSTDLIB_API __declspec(dllexport)
|
||||||
#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
|
#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
|
||||||
# define ZSTDLIB_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
|
# define ZSTDLIB_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
|
||||||
|
|||||||
Reference in New Issue
Block a user