help-gsasl
[Top][All Lists]
Advanced

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

Re: win32 Visual Studio 2005 project for gsasl


From: Simon Josefsson
Subject: Re: win32 Visual Studio 2005 project for gsasl
Date: Fri, 11 Apr 2008 09:40:18 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Simon Josefsson <address@hidden> writes:

>> Well, I tried to be as minimal with the changes as possible. If you
>> really want to say bye bye to *.def you need to use Windows way of
>> exporting functions & variables to DLL. In libidn's win32 Perl script
>> I exactly replace all exports with LIBIDN_API, and for gsasl we would
>> need to do the same:
>>
>> /* GSASL Windows DLL */
>> #ifndef GSASL_API
>> # if defined(_WIN32) && !defined(GSASL_STATIC)
>> #  ifdef GSASL_EXPORTS
>> #   define GSASL_API  __declspec(dllexport)
>> #  else /* GSASL_EXPORTS */
>> #   define GSASL_API  __declspec(dllimport)
>> #  endif /* GSASL_EXPORTS */
>> # else /* _WIN32 && !GSASL_STATIC */
>> #  define GSASL_API extern
>> # endif /* _WIN32 && !GSASL_STATIC */
>> #endif /* GSASL_API */
>>
>> And then use "GSASL_API" in all official headers instead of "export"
>> for functions and variables. This is only related to those that should
>> be exported to DLL. On GCC ELF (Linux, Mac, etc.) all "export" are
>> exported, on Windows you need to explicitly mark it with
>> __declspec(dllexport) or use *.def files, or you won't get anything
>> into DLL.
>> Also when you will be using the DLL you need to use
>> __declspec(dllimport).
>>
>> So if you want I can prepare LIBIDN and GSASL patches that define this
>> inside the sources, not with external tricks.
>
> Thanks for explaining.  Maintaining the *.def file manually will be a
> problem, so I'd appreciate if you could prepare a patch that adds a
> GSASL_API symbol.  I'd prefer to keep the 'extern' markers in the code
> though, so on non-Windows systems I would want that GSASL_API evaluates
> to the empty string.  That isn't a problem for Windows, right?
>
> Note that I've applied parts of your patches to git, so it is easiest if
> you make the patch apply to the current git head.

Hi again Adam.  I now looked more closely how your patch in libidn
worked, and it used a perl script gen-win32-headers.pl.  That approach
seems good since avoids the static config.h which was part of your gsasl
patch.  If you have the time, please use this approach for gsasl as
well.  I don't care strongly that gsasl.h is handled the same way,
having a GSASL_API define is fine, so maybe the gen-win32-headers.pl
script in gsasl could only for generating config.h.

I'll wait with installing the other win32 related fixes until I hear
from you.

Thanks,
/Simon




reply via email to

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