bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] wrong declaration of libintl_version on Windows with M


From: Vincent Torri
Subject: Re: [bug-gettext] wrong declaration of libintl_version on Windows with MSYS2/mingw-w64
Date: Sat, 2 Feb 2019 07:55:54 +0100

hello

any news about this problem ?

thank you

Vincent Torri

On Wed, Jan 23, 2019 at 11:16 AM Vincent Torri <address@hidden> wrote:
>
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]