cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: probs. building libcurl w/gssapi on win32

From: David Rosenstrauch <darose_at_darose.net>
Date: Wed, 21 May 2008 17:49:20 -0400

Dan Fandrich wrote:
> On Wed, May 21, 2008 at 05:17:52PM -0400, David Rosenstrauch wrote:
>> For the specific changes you cited above, MIT KFW also defines these
>> preprocessor definitions (in the win-mac.h file), which results in
>> duplicate definition errors. So the ifndef's are required to get the
>> code to compile.

> That makes some sense, but that MIT code is really messing up the name
> space by making its internal configure definitions public. That can cause
> some real problems with apps if the environments aren't the same.

Agreed, but that's obviously beyond our control here. Near as I can
tell all we can really do is code around it.

> For these
> cases, it's probably better to surround those #defines with an #ifdef on
> the macro itself, i.e.
>
> #ifndef HAVE_STDLIB_H
> #define HAVE_STDLIB_H 1
> #endif
>
> instead of
>
> #ifndef HAVE_GSSMIT
> #define HAVE_STDLIB_H 1
> #endif

Apologies if I'm in error here - my C++ knowledge is weak - but
wouldn't that not compile? I'm assuming that VC would process curl's
config-win32.h file first and define HAVE_STDLIB_H, and then later (via
an include) try to process KFW's win-mac.h file and try to define that
directive again. Or am I misunderstanding the way VC does preprocessing?

>>>> +#if (defined(WIN32) || defined(MSDOS) || defined(__EMX__) || defined(__SYMBIAN32__)) && !defined(HAVE_GSSMIT)
>>>> #define MSDOS_FILESYSTEM 1
>>>> #endif
>> Again, this is to work around a duplicate definition error in win-mac.h.
>
> Another case of cluttering up the namespace. Here, this is an internal
> curl definition so I can just change it within curl (and cross my fingers
> that the new name isn't also defined by GSSMIT).

Sounds good. Do you want to update this, or do I need to generate a new
patch and resend? (BTW, I've attached KFW's win-mac.h file to reference
if you want to make sure you choose something that doesn't give a name
clash.)

DR

Received on 2008-05-21