octave-maintainers
[Top][All Lists]
Advanced

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

Re: distinguishing octave versions with ifdef


From: William S Fulton
Subject: Re: distinguishing octave versions with ifdef
Date: Tue, 24 Nov 2009 21:49:59 +0000
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

As Xavier mentioned, this patch is critical for dealing with API changes
in a backwards compatible manner. Should we post the patch somewhere
else for consideration?

William

Xavier Delacour wrote:
Please consider the following patch that adds a non-string/numerical
form of the octave api version in src/version.h.

This allows use of preprocessor conditionals to distinguish between
octave versions, and in particular is key for SWIG to be able to
generate bindings that compile under multiple versions of octave.

Thanks,
Xavier


On Sun, Jul 5, 2009 at 5:25 PM, Xavier
Delacour<address@hidden> wrote:
I would like to make oct-file plugins that compile properly against
multiple versions of octave, in the face of internal API changes.
Ideally I want something like

#if OCTAVE_API_VERSION >= 37
// use new api
#else
// use old api
#endif

In src/version.h I see

#define OCTAVE_API_VERSION "api-v37"

which is difficult to use from the preprocessor.

Can someone suggest a way to do what I want? (without resorting to
configure magic and generating my own defines, etc).

Thanks,
Xavier





reply via email to

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