help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] Compatibility with old and new inline functions in GSL


From: Joseph Wakeling
Subject: [Help-gsl] Compatibility with old and new inline functions in GSL
Date: Thu, 27 May 2010 19:32:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

Hello all,

A small problem I came up against while working on an extension I'm
building to GSL.

Later versions of GSL (1.13+ I think?) have the gsl_inline.h header,
which defines various preprocessor macros with respect to inline
functions -- in particular, INLINE_FUN.  This allows code to be defined
in header files in the form,

    #ifdef HAVE_INLINE

    INLINE_FUN int
    gsl_foo(const gsl_rng *r)
    {
        /* something ... */
    }

The 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?

Thanks & best wishes,

    -- Joe



reply via email to

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