bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] Win32 and dllimport/dllexport


From: Amir Hossein Zamani Safa
Subject: [Bug-gsl] Win32 and dllimport/dllexport
Date: Tue, 21 Aug 2007 03:39:09 -0700 (PDT)

it's not actually a bug, but gsl_type.h has a section like this:
#ifdef WIN32
#  ifdef GSL_DLL
#    ifdef DLL_EXPORT
#      define GSL_VAR extern __declspec(dllexport)
#      define GSL_EXPORT __declspec(dllexport)
#    else
#      define GSL_VAR extern __declspec(dllimport)
#      define GSL_EXPORT __declspec(dllimport)
#    endif
#  else
#    define GSL_VAR extern
#    define GSL_EXPORT
#  endif
#else
#  define GSL_VAR extern
#  define GSL_EXPORT
#endif

"DLL_EXPORT" is a general name and every dll may redefine it to export its 
symbols. This name causes trouble in some situations, eg when someone uses 
libgsl.dll in another dll (foo.dll) where it need to import GSL symbols into, 
and export other symbols from foo.dll and this will end up with linkage errors.

It's better to rename it as GSL_DLL_SOURCE or something unique like that.

       
---------------------------------
Shape Yahoo! in your own image.  Join our Network Research Panel today!


reply via email to

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