[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Building Subversion DLLs

From: Timothy Wall <twall_at_oculustech.com>
Date: 2005-12-07 15:40:45 CET

On Dec 7, 2005, at 8:27 AM, Ivan Zhakov wrote:

> On 12/7/05, Timothy Wall <twall@oculustech.com> wrote:
>>
>> We use a utility program to generate the list of exports and then
>> specify explicitly those things we do (or don't) want exported. This
>> file is passed to the linker (.def). We find this preferable to
>> littering header files with tons of declspec cruft.
> Thanks, we already have done this (extractor.py). But we run into
> problem with exporting/importing *variables*, not functions.

For variables, you will need an explicit __declspec(dllimport) on
each variable that you are *importing*.

Typically this is done like thus:

#ifdef BUILDING_FOO_DLL
#define FOO_DECLSPEC
#else
#define FOO_DECLSPEC __declspec(dllimport)
#endif

And you have to use that macro in front of every exported variable.
We insert this code in the header files with a simple post-processor
for the variable types we actually export (mostly const char*, but a
few others).

Timothy Wall
Oculus Technologies Corporation

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 7 15:42:52 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.