McCode icon indicating copy to clipboard operation
McCode copied to clipboard

MCCODE_VERSION as integer

Open tkittel opened this issue 2 years ago • 0 comments

Hi there,

A hopefully very easy to implement but potentially very useful feature would be to have the MCCODE_VERSION available as an easily comparable integer. This will make life a lot easier for externally kept component files which might have to deal with different versions of McStas. To be specific, in addition to:

#define MCCODE_VERSION "2.7.1"

It would be great to have e.g. (1e6*major+1e3*minor+patch):

#define MCCODE_VERSION_NBR 2007001

because then component code can do:

#if MCCODE_VERSION_NBR >= 3001000
   /* call function available only starting from McStas 3.1 */
#else
   /* use some legacy alternative - to be removed only when all users have McStas 3.1 */
#endif

I realise this feature request would help just a few people, but I hope it is trivial to add.

tkittel avatar Feb 24 '22 11:02 tkittel