KDE_VERSION

Harri Porten porten at kde.org
Fri Dec 27 15:52:13 GMT 2002


On Fri, 27 Dec 2002, Stephan Kulow wrote:

> I'm quite confused too. I thought we leared from this 305/306 desaster, that
> we use >3 digits now. I would like to follow Qt's way to 0x030190 because
> it would be larger than any version before and we had a way to enlarge it at
> our own space (and have 89 versions to go for 3.1.x :)

How about going even one step further and use 4 full hex digits.
Inspired by Python[1] and the Linux kernel[2] I propose to define:

#define KDE_VERSION_MAJOR 3
#define KDE_VERSION_MINOR 2
#define KDE_VERSION_MICRO 0
#define KDE_RELEASE_LEVEL b2

#define KDE_VERSION_STRING "3.2.0 beta2"

#define KDE_VERSION_HEX ((KDE_VERSION_MAJOR << 24) | \
                        (KDE_VERSION_MINOR << 16) | \
                        (KDE_VERSION_MICRO <<  8) | \
                        (KDE_RELEASE_LEVEL <<  0))

Together with

#define KDE_CALC_VERSION(a,b,c) (((a) << 24) + ((b) << 16) + ((c) << 8)

one could even avoid direct usage of the raw hex number by using

#if KDE_VERSION_HEX < KDE_CALC_VERSION(3, 3, 1)
 ...
#endif

Harri.

[1] /usr/include/python2.1/patchlevel.h
[2] /usr/include/linux/version.h





More information about the kde-core-devel mailing list