KDELibs4Support

kdeversion.h File Reference
#include <kdelibs4support_export.h>
#include <kdelibs4support_version.h>
Include dependency graph for kdeversion.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 KDE
 

Macros

#define KDE_IS_VERSION(a, b, c)   ( KDE_VERSION >= KDE_MAKE_VERSION(a,b,c) )
 
#define KDE_MAKE_VERSION(a, b, c)   (((a) << 16) | ((b) << 8) | (c))
 
#define KDE_VERSION   KDE_MAKE_VERSION(KDE_VERSION_MAJOR,KDE_VERSION_MINOR,KDE_VERSION_RELEASE)
 
#define KDE_VERSION_MAJOR   KDELIBS4SUPPORT_VERSION_MAJOR
 
#define KDE_VERSION_MINOR   KDELIBS4SUPPORT_VERSION_MINOR
 
#define KDE_VERSION_RELEASE   KDELIBS4SUPPORT_VERSION_PATCH
 
#define KDE_VERSION_STRING   KDELIBS4SUPPORT_VERSION_STRING
 

Functions

unsigned int KDE::version ()
 
unsigned int KDE::versionMajor ()
 
unsigned int KDE::versionMinor ()
 
unsigned int KDE::versionRelease ()
 
const char * KDE::versionString ()
 

Detailed Description

The file contains macros and functions related to the KDE version.

Definition in file kdeversion.h.

Macro Definition Documentation

#define KDE_IS_VERSION (   a,
  b,
 
)    ( KDE_VERSION >= KDE_MAKE_VERSION(a,b,c) )

Check if the KDE version matches a certain version or is higher.

This macro is typically used to compile conditionally a part of code:

1 #if KDE_IS_VERSION(4,0,90)
2 // Code for KDE 4.1
3 #else
4 // Code for KDE 4.0
5 #endif
Warning
Especially during development phases of KDE, be careful when choosing the version number that you are checking against. Otherwise you might risk to break the next KDE release. Therefore be careful that development version have a version number lower than the released version, so do not check e.g. for KDE 4.1 with KDE_IS_VERSION(4,1,0) but with the actual version number at a time a needed feature was introduced.

Definition at line 110 of file kdeversion.h.

#define KDE_MAKE_VERSION (   a,
  b,
 
)    (((a) << 16) | ((b) << 8) | (c))

Make a number from the major, minor and release number of a KDE version.

This function can be used for preprocessing when KDE_IS_VERSION is not appropriate.

Definition at line 76 of file kdeversion.h.

Version of KDE as number, at compile time.

This macro contains the KDE version in number form. As it is a macro, it contains the version at compile time. See version() if you need the KDE version used at runtime.

Definition at line 86 of file kdeversion.h.

#define KDE_VERSION_MAJOR   KDELIBS4SUPPORT_VERSION_MAJOR

Major version of KDE, at compile time.

Definition at line 55 of file kdeversion.h.

#define KDE_VERSION_MINOR   KDELIBS4SUPPORT_VERSION_MINOR

Minor version of KDE, at compile time.

Definition at line 61 of file kdeversion.h.

#define KDE_VERSION_RELEASE   KDELIBS4SUPPORT_VERSION_PATCH

Release version of KDE, at compile time.

Definition at line 67 of file kdeversion.h.

#define KDE_VERSION_STRING   KDELIBS4SUPPORT_VERSION_STRING

Version of KDE as string, at compile time.

This macro contains the KDE version in string form. As it is a macro, it contains the version at compile time. See versionString() if you need the KDE version used at runtime.

Note
The version string might contain a section in parentheses, especially for development versions of KDE. If you use that macro directly for a file format (e.g. OASIS Open Document) or for a protocol (e.g. http) be careful that it is appropriate. (Fictional) example: "4.0.90 (>=20070101)"

Definition at line 48 of file kdeversion.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 22:50:59 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.