bug-gettext
[Top][All Lists]
Advanced

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

[bug-gettext] [bug #56132] wrong declaration of libintl_version on Windo


From: Vincent Torri
Subject: [bug-gettext] [bug #56132] wrong declaration of libintl_version on Windows with MSYS2/mingw-w64
Date: Sun, 14 Apr 2019 08:09:42 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

URL:
  <https://savannah.gnu.org/bugs/?56132>

                 Summary: wrong declaration of libintl_version on Windows with
MSYS2/mingw-w64
                 Project: GNU gettext
            Submitted by: vtorri
            Submitted on: dim. 14 avril 2019 12:09:40 UTC
                Category: Build
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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 replaced with LIBINTL_DLL_EXPORTED, and EAPI with whatever you
like). This definition of EAPI supports also the static linking of
symbols on Windows.

regards




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56132>

_______________________________________________
  Message posté via Savannah
  https://savannah.gnu.org/




reply via email to

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