|
From: | Peter Johansson |
Subject: | Re: [Help-gsl] Compatibility with old and new inline functions in GSL |
Date: | Thu, 27 May 2010 22:50:18 -0400 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 |
Hi Joseph, On 5/27/10 1:32 PM, Joseph Wakeling wrote:
This is a pefect use case for autoconf. Rather than checking which GSL version your client is using, you can implement a compilation test in your configure checking if 'gsl/gsl_inline.h' exists. If it exists define HAVE_GSL_INLINE and modify you preprocessor code toThe problem is, of course, an extension can't necessarily assume a particular version of GSL, so if I want it to be compatible with earlier versions I can't assume the presence of gsl_inline.h. So, this leads to the need to check for the version of GSL, and only if it is high enough to call #include<gsl/gsl_inline.h>; something along the lines of, #include<gsl_version.h> #if GSL_VERSION>= 1.13 #include<gsl/gsl_inline.h> #else #define INLINE_FUN extern inline #endif ... except that since GSL_VERSION is actually a string "1.x" I'm not sure I can do the comparison. Is there any recommended procedure for dealing with this kind of version compatibility in GSL?
#ifdef HAVE_GSL_INLINE #include<gsl/gsl_inline.h> #else #define INLINE_FUN extern inline #endif If you need help with the autoconf syntax, please shoot an email. Cheers, Peter
[Prev in Thread] | Current Thread | [Next in Thread] |