[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gettext] wrong declaration of libintl_version on Windows with MSYS2
From: |
Vincent Torri |
Subject: |
[bug-gettext] wrong declaration of libintl_version on Windows with MSYS2/mingw-w64 |
Date: |
Wed, 23 Jan 2019 11:16:56 +0100 |
Hello
in gettext-runtime/intl/libgnuintl.h, I see :
#if 1 && BUILDING_LIBINTL
#define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default")))
#else
#define LIBINTL_DLL_EXPORTED
#endif
and
extern LIBINTL_DLL_EXPORTED __declspec (dllimport) int libintl_version;
because of that, i have a warning when compiling the shared library :
./version.c:24:5: warning: 'libintl_version' redeclared without
dllimport attribute: previous dllimport ignored [-Wattributes]
Indeed, when compiling a DLL, the exported symbols should have the
__declspec (dllexport)
attribute and when using the DLL, the symbol should have the
__declspec (dllimport)
attribute.
With the current code, the attribute of libintl_version is always
dllimport, which is wrong.
In our project, where are using this :
#ifdef _WIN32
# ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif
# else
# define EAPI __declspec(dllimport)
# endif
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif
and we add EAPI in front of each exported symbols. (EFL_BUILD should
be reaplced with LIBINTL_DLL_EXPORTED, and EAPI with whatever you
like). This definition of EAPI supports also the static linking of
symbols on Windows.
regards
Vincent Torri
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug-gettext] wrong declaration of libintl_version on Windows with MSYS2/mingw-w64,
Vincent Torri <=