[Help-gnutls] Re: 1.2.9 release candidate

Daniel Stenberg daniel at haxx.se
Tue Nov 1 10:38:16 CET 2005


On Tue, 1 Nov 2005, Simon Josefsson wrote:

>> Of course I can make a configure-check for them, but it would be nice with 
>> some simple preprocessor magic...
>
> I think a configure check is the simplest solution available.  If you don't 
> want to pollute your source code with #ifdef's, you could have configure 
> define those two symbols to 0 if they aren't defined by gnutls.h.

Of course. But my argument was not so much of concern of how the #ifdefs will 
look in my code (libcurl being massively portable we have #ifdefs all over 
already), it is how my code figures out what the installed GnuTLS supports or 
not. (Or in this case, what the headers contain or not.)

In OpenSSL land, I've almost always been able to avoid checking for version- 
specific features in configure by using preprocessor magic such as checking 
for specific version numbers etc. Like this:

#if OPENSSL_VERSION_NUMBER >= 0x0090581fL
#define HAVE_SSL_GET1_SESSION 1
#else
#undef HAVE_SSL_GET1_SESSION
#endif

> I usually want to make the core code look good for the latest-and-greatest 
> features, and work around missing functionality in earlier releases through 
> some replacement stuff in configure.

Well, you could easily just add a simple define in the header file next to the 
enums that we could #ifdef with to figure this out.

Or if you'd have a numerical version define (like OpenSSL and others) we could 
do a numerical check like above.

By ducking for this, you force every single GnuTLS-user out there to add 
feature-checks to our configure scripts. It might not bother you as author of 
the lib, but it bothers me and I see this in the big perspective and how this 
will affect us in the long run and how this will make our configure scripts 
having to check for more and more features should more of these things occur 
later on. (And I actually consider that more likely than that _no_ more such 
things will occur.)

Please reconsider.

-- 
          -=- Daniel Stenberg -=- http://daniel.haxx.se -=-
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol





More information about the Gnutls-help mailing list