2012-06-24 14:31, Jordi Gutiérrez Hermoso skrev:
> On 24 June 2012 05:44, Paul Dreik <sl...@pauldreik.se> wrote:
>
>> A good example on how to handle version comparisons is how boost does
>> it, see the BOOST_VERSION macro description on
>> http://www.boost.org/doc/libs/1_46_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.boost_informational_macros
>> This is something for the octave developers to decide.
> We generally discourage checking for versions in GNU code. Instead,
> check for features. Use autoconf macros to check for whatever it is
> you need. Other OF packages use autoconf generously.
>
> If your package needs to know the minor Octave revision number,
> something is very wrong with Octave, your package, or both. Minor
> revision numbers should not be changing the interface.
>
> - Jordi G. H.
I get your point, although I do not agree it is the universal solution
to everything. But how would one check for the feature in this case? The
relevant code is this: (the only difference is FS instead of G at the
third argument)
#if MAJORVERSION==3 && MINORVERSION<2
# define DEFUN_DLD_SOCKET_CONSTANT(name, help )                \
  DEFUNX_DLD ( #name, F ## name, FS ## name, args, nargout, help)    \
  {    return octave_value( name ); };                   
#else
# define DEFUN_DLD_SOCKET_CONSTANT(name, help )                \
  DEFUNX_DLD ( #name, F ## name, G ## name, args, nargout, help)    \
  {    return octave_value( name ); };                   
#endif

This topic has generated a lot of attention. The reason I care is that I
once got really annoyed that the sockets package did not work anymore on
the octave version I used.
I think it is a good thing to keep things working for older versions as
well if the effort is small.
Paul

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to