jpayne@69: /* SPDX-License-Identifier: 0BSD */ jpayne@69: jpayne@69: /** jpayne@69: * \file lzma/version.h jpayne@69: * \brief Version number jpayne@69: * \note Never include this file directly. Use instead. jpayne@69: */ jpayne@69: jpayne@69: /* jpayne@69: * Author: Lasse Collin jpayne@69: */ jpayne@69: jpayne@69: #ifndef LZMA_H_INTERNAL jpayne@69: # error Never include this file directly. Use instead. jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: /** \brief Major version number of the liblzma release. */ jpayne@69: #define LZMA_VERSION_MAJOR 5 jpayne@69: jpayne@69: /** \brief Minor version number of the liblzma release. */ jpayne@69: #define LZMA_VERSION_MINOR 6 jpayne@69: jpayne@69: /** \brief Patch version number of the liblzma release. */ jpayne@69: #define LZMA_VERSION_PATCH 4 jpayne@69: jpayne@69: /** jpayne@69: * \brief Version stability marker jpayne@69: * jpayne@69: * This will always be one of three values: jpayne@69: * - LZMA_VERSION_STABILITY_ALPHA jpayne@69: * - LZMA_VERSION_STABILITY_BETA jpayne@69: * - LZMA_VERSION_STABILITY_STABLE jpayne@69: */ jpayne@69: #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE jpayne@69: jpayne@69: /** \brief Commit version number of the liblzma release */ jpayne@69: #ifndef LZMA_VERSION_COMMIT jpayne@69: # define LZMA_VERSION_COMMIT "" jpayne@69: #endif jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * Map symbolic stability levels to integers. jpayne@69: */ jpayne@69: #define LZMA_VERSION_STABILITY_ALPHA 0 jpayne@69: #define LZMA_VERSION_STABILITY_BETA 1 jpayne@69: #define LZMA_VERSION_STABILITY_STABLE 2 jpayne@69: jpayne@69: jpayne@69: /** jpayne@69: * \brief Compile-time version number jpayne@69: * jpayne@69: * The version number is of format xyyyzzzs where jpayne@69: * - x = major jpayne@69: * - yyy = minor jpayne@69: * - zzz = revision jpayne@69: * - s indicates stability: 0 = alpha, 1 = beta, 2 = stable jpayne@69: * jpayne@69: * The same xyyyzzz triplet is never reused with different stability levels. jpayne@69: * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta jpayne@69: * or 5.1.0 stable. jpayne@69: * jpayne@69: * \note The version number of liblzma has nothing to with jpayne@69: * the version number of Igor Pavlov's LZMA SDK. jpayne@69: */ jpayne@69: #define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \ jpayne@69: + LZMA_VERSION_MINOR * UINT32_C(10000) \ jpayne@69: + LZMA_VERSION_PATCH * UINT32_C(10) \ jpayne@69: + LZMA_VERSION_STABILITY) jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * Macros to construct the compile-time version string jpayne@69: */ jpayne@69: #if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA jpayne@69: # define LZMA_VERSION_STABILITY_STRING "alpha" jpayne@69: #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA jpayne@69: # define LZMA_VERSION_STABILITY_STRING "beta" jpayne@69: #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE jpayne@69: # define LZMA_VERSION_STABILITY_STRING "" jpayne@69: #else jpayne@69: # error Incorrect LZMA_VERSION_STABILITY jpayne@69: #endif jpayne@69: jpayne@69: #define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \ jpayne@69: #major "." #minor "." #patch stability commit jpayne@69: jpayne@69: #define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \ jpayne@69: LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) jpayne@69: jpayne@69: jpayne@69: /** jpayne@69: * \brief Compile-time version as a string jpayne@69: * jpayne@69: * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable jpayne@69: * versions don't have any "stable" suffix). In future, a snapshot built jpayne@69: * from source code repository may include an additional suffix, for example jpayne@69: * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form jpayne@69: * in LZMA_VERSION macro. jpayne@69: */ jpayne@69: #define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \ jpayne@69: LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \ jpayne@69: LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \ jpayne@69: LZMA_VERSION_COMMIT) jpayne@69: jpayne@69: jpayne@69: /* #ifndef is needed for use with windres (MinGW-w64 or Cygwin). */ jpayne@69: #ifndef LZMA_H_INTERNAL_RC jpayne@69: jpayne@69: /** jpayne@69: * \brief Run-time version number as an integer jpayne@69: * jpayne@69: * This allows an application to compare if it was built against the same, jpayne@69: * older, or newer version of liblzma that is currently running. jpayne@69: * jpayne@69: * \return The value of LZMA_VERSION macro at the compile time of liblzma jpayne@69: */ jpayne@69: extern LZMA_API(uint32_t) lzma_version_number(void) jpayne@69: lzma_nothrow lzma_attr_const; jpayne@69: jpayne@69: jpayne@69: /** jpayne@69: * \brief Run-time version as a string jpayne@69: * jpayne@69: * This function may be useful to display which version of liblzma an jpayne@69: * application is currently using. jpayne@69: * jpayne@69: * \return Run-time version of liblzma jpayne@69: */ jpayne@69: extern LZMA_API(const char *) lzma_version_string(void) jpayne@69: lzma_nothrow lzma_attr_const; jpayne@69: jpayne@69: #endif