[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why no more OCTAVE_API_VERSION_NUMBER?
From: |
Orion Poplawski |
Subject: |
Re: Why no more OCTAVE_API_VERSION_NUMBER? |
Date: |
Thu, 02 Jan 2014 20:04:12 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 01/02/2014 02:09 PM, John W. Eaton wrote:
> On 01/02/2014 02:16 PM, Orion Poplawski wrote:
>> On 01/01/2014 11:39 PM, John W. Eaton wrote:
>>> On 12/30/2013 03:41 PM, Orion Poplawski wrote:
>>>> This commit:
>>>>
>>>> changeset: 17510:7542f4496974
>>>> user: John W. Eaton <address@hidden>
>>>> date: Sat Sep 28 15:04:14 2013 -0400
>>>> summary: eliminate some macros in version.h
>>>>
>>>> Appears to have gotten rid of OCTAVE_API_VERSION_NUMBER from
>>>> version.h. It
>>>> appears that at least swig uses this macro in #ifdefs to handle
>>>> changes in the
>>>> Octave api and this is breaking swig generated code for octave 3.8.0
>>>> (see
>>>> https://sourceforge.net/p/swig/bugs/1353/).
>>>>
>>>> Is there a particular reason for this change? Is there a better way
>>>> to check
>>>> API versions? The text string OCTAVE_API_VERSION is a lot harder to
>>>> parse.
>>>
>>> I removed it because it was no longer needed in Octave.
>>>
>>> jwe
>>
>> So:
>>
>> - Any chance of it being re-instated?
>>
>> - Is there a better/alternative way to check for version changes in
>> the code?
>> Doing cpp #ifdef checks comparisons on strings is pretty difficult.
>
> I recommend not using version numbers to decide which features are
> available and instead use a configure script that tests for the required
> features.
>
> jwe
>
Yeah, in general that is a good suggestion. It gets tricky though in
the case of SWIG. User's of swig don't necessarily know what features
of octave that it needs to know about - swig is supposed to abstract
that. I suppose swig could distribute a m4 file with the checks that it
needs, but that may be messy as well.
--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane address@hidden
Boulder, CO 80301 http://www.cora.nwra.com