Feature Request: SDK version macro as integers

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
tonic
Posts: 69
Joined: Mon Dec 10, 2007 6:18 pm
Contact:

Feature Request: SDK version macro as integers

Post by tonic »

IrrCompileConfig.h currently contains this:

Code: Select all

#define IRRLICHT_SDK_VERSION "1.5"
One would think this would help to choose a code path compile-time, but unfortunately it doesn't really help since this is a string definition.

This is what I'd like to do:

Code: Select all

#if IRRLICHT_SDK_VERSION_MAJOR==1 && IRRLICHT_SDK_VER_MINOR==4
 // 1.4 specific code
#elif IRRLICHT_SDK_VERSION_MAJOR==1 && IRRLICHT_SDK_VER_MINOR==5
 // 1.5 specific code
#elif IRRLICHT_SDK_VERSION_MAJOR==1 && IRRLICHT_SDK_VER_MINOR>5
 // svn trunk specific code (towards 1.6)
#endif
For example, I have a little UI library. Irrlicht API has gotten a few little changes along the way, requiring e.g. different call to drawVertexPrimitiveList. Latest change in svn changed irr::core::dimension2d<s32> code to use irr::core::dimension2d<u32> instead. These are minor things, but for now I have to require app developer to define additional macro to specify actual Irrlicht API version, instead of automatically adapting to the situation.

In addition to MAJOR and the MINOR macro, there should be version integer macro for the maintenance releases (like 1.5.1).

See this Wikipedia entry for some reference naming for the different parts of sdk version:
major.minor(.build(.revision)) or major.minor(.maintenance(.build)).

I propose this is fixed so that version 1.5.1 release gets these additional macros:

Code: Select all

#define IRRLICHT_SDK_VERSION_MAJOR  1
#define IRRLICHT_SDK_VERSION_MINOR  5
#define IRRLICHT_SDK_VERSION_MAINTENANCE  1
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, I was also planning for such a thing, will be include right away :D
Post Reply