libtool-patches
[Top][All Lists]
Advanced

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

Re: Win32 libltdl issue


From: Ralf Wildenhues
Subject: Re: Win32 libltdl issue
Date: Wed, 27 Apr 2005 08:39:40 +0200
User-agent: Mutt/1.4.1i

Hi Howard,

* Howard Chu wrote on Tue, Apr 26, 2005 at 02:40:45PM CEST:
> The definition of LT_SCOPE in libltdl/ltdl.h needs a tweak; if some 
> other DLL (e.g. module 'foo') uses libltdl then it needs to define 
> LIBLTDL_DLL_IMPORT. Since 'foo' is compiled as a DLL, DLL_EXPORT will 
> already be automatically defined, resulting in LT_SCOPE getting defined 
> twice. A quick solution is just to undef it before the second definition:

Acknowledged.

> --- ltdl.h.O    2001-08-13 10:25:49.000000000 -0700
> +++ ltdl.h      2005-04-26 05:20:45.044139776 -0700
> @@ -131,6 +131,7 @@
>  #      define LT_SCOPE __declspec(dllexport)
>  #    endif
>  #    ifdef LIBLTDL_DLL_IMPORT  /* define if linking with this dll */
> +#      undef LT_SCOPE
>  #      define LT_SCOPE extern __declspec(dllimport)
>  #    endif
>  #  endif
> 
> This situation is quite ugly because it means the user's *code* has to 
> know whether they are linking against a shared or static libltdl, and 
> it's just not possible to determine this dynamically/automatically at 
> compile time.

Hehe.  Note that I have only very limited knowledge about linking under
Win32, but this LT_SCOPE thing has always struck me as fishy (if only
because you have only one #define for what may be two different things).

> Since LT_SCOPE is only used for the three lt_*alloc/free function 
> pointers, I suggest removing these declarations completely and using 
> accessor functions to set/get their values.

Erm, does this apply to data objects only (as opposed to functions)?
We have several functions with LT_SCOPE.  With branch-2-0 and HEAD of
libltdl things get more intricate.  Their failure on mingw have to do
with these LT_SCOPE issues.

Somebody knowledgeable about this stuff should look into all this..

Regards,
Ralf




reply via email to

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