From f471bb6e503c29d2dc14bf594882476d48fa7b1d Mon Sep 17 00:00:00 2001 From: Schaich Date: Tue, 27 Apr 2021 00:07:55 +0900 Subject: [PATCH] Export the INTERNAL functions The testcommon library, which is outside of this link unit, is referencing the INTERNAL functions, so despite the name they need to be exported. The export code is copy&pasted from the ZINT_EXTERN definition which can't be reused over preprocessor limitations. We might just use ZINT_EXTERN instead though --- backend/common.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/common.h b/backend/common.h index c6c4b071..eccf574d 100644 --- a/backend/common.h +++ b/backend/common.h @@ -58,9 +58,18 @@ #define ustrncat(target, source, count) strncat((char *) (target), (const char *) (source), (count)) #if defined(__GNUC__) && !defined(_WIN32) && !defined(ZINT_TEST) -#define INTERNAL __attribute__ ((visibility ("hidden"))) -#else -#define INTERNAL +# define INTERNAL __attribute__ ((visibility ("hidden"))) +#else /* despite the name, the test cases are referencing the INTERNAL functions, so they need to be exported */ +# if defined(ZINT_TEST) +# if defined(DLL_EXPORT) || defined(PIC) || defined(_USRDLL) +# define INTERNAL __declspec(dllexport) +# elif defined(ZINT_DLL) +# define INTERNAL __declspec(dllimport) +# endif +# endif +# if !defined(INTERNAL) +# define INTERNAL +# endif #endif #if defined(ZINT_TEST)