Warning, /frameworks/attica/src/version.h.cmake is written in an unsupported language. File is not indexed.
0001 /* 0002 * SPDX-FileCopyrightText: 2007 Sebastian Trueg <trueg@kde.org> 0003 * SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef _ATTICA_VERSION_H_ 0009 #define _ATTICA_VERSION_H_ 0010 0011 #include "attica_export.h" 0012 0013 /// @brief Attica version as string at compile time. 0014 #define LIBATTICA_VERSION_STRING "${ATTICA_VERSION}" 0015 0016 /// @brief The major Attica version number at compile time 0017 #define LIBATTICA_VERSION_MAJOR ${ATTICA_VERSION_MAJOR} 0018 0019 /// @brief The minor Attica version number at compile time 0020 #define LIBATTICA_VERSION_MINOR ${ATTICA_VERSION_MINOR} 0021 0022 /// @brief The Attica release version number at compile time 0023 #define LIBATTICA_VERSION_RELEASE ${ATTICA_VERSION_PATCH} 0024 0025 /** 0026 * \brief Create a unique number from the major, minor and release number of a %Attica version 0027 * 0028 * This function can be used for preprocessing. For version information at runtime 0029 * use the version methods in the Attica namespace. 0030 */ 0031 #define LIBATTICA_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c)) 0032 0033 /** 0034 * \brief %Attica Version as a unique number at compile time 0035 * 0036 * This macro calculates the %Attica version into a number. It is mainly used 0037 * through LIBATTICA_IS_VERSION in preprocessing. For version information at runtime 0038 * use the version methods in the Attica namespace. 0039 */ 0040 #define LIBATTICA_VERSION \ 0041 LIBATTICA_MAKE_VERSION(LIBATTICA_VERSION_MAJOR,LIBATTICA_VERSION_MINOR,LIBATTICA_VERSION_RELEASE) 0042 0043 /** 0044 * \brief Check if the %Attica version matches a certain version or is higher 0045 * 0046 * This macro is typically used to compile conditionally a part of code: 0047 * \code 0048 * #if LIBATTICA_IS_VERSION(2,1) 0049 * // Code for Attica 2.1 0050 * #else 0051 * // Code for Attica 2.0 0052 * #endif 0053 * \endcode 0054 * 0055 * For version information at runtime 0056 * use the version methods in the Attica namespace. 0057 */ 0058 #define LIBATTICA_IS_VERSION(a,b,c) ( LIBATTICA_VERSION >= LIBATTICA_MAKE_VERSION(a,b,c) ) 0059 0060 0061 namespace Attica { 0062 /** 0063 * @brief Returns the major number of Attica's version, e.g. 0064 * 1 for %Attica 1.0.2. 0065 * @return the major version number at runtime. 0066 */ 0067 ATTICA_EXPORT unsigned int versionMajor(); 0068 0069 /** 0070 * @brief Returns the minor number of Attica's version, e.g. 0071 * 0 for %Attica 1.0.2. 0072 * @return the minor version number at runtime. 0073 */ 0074 ATTICA_EXPORT unsigned int versionMinor(); 0075 0076 /** 0077 * @brief Returns the release of Attica's version, e.g. 0078 * 2 for %Attica 1.0.2. 0079 * @return the release number at runtime. 0080 */ 0081 ATTICA_EXPORT unsigned int versionRelease(); 0082 0083 /** 0084 * @brief Returns the %Attica version as string, e.g. "1.0.2". 0085 * 0086 * On contrary to the macro LIBATTICA_VERSION_STRING this function returns 0087 * the version number of Attica at runtime. 0088 * @return the %Attica version. You can keep the string forever 0089 */ 0090 ATTICA_EXPORT const char* versionString(); 0091 } 0092 0093 #endif