version.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /**
  2. * \file lzma/version.h
  3. * \brief Version number
  4. * \note Never include this file directly. Use <lzma.h> instead.
  5. */
  6. /*
  7. * Author: Lasse Collin
  8. *
  9. * This file has been put into the public domain.
  10. * You can do whatever you want with this file.
  11. */
  12. #ifndef LZMA_H_INTERNAL
  13. # error Never include this file directly. Use <lzma.h> instead.
  14. #endif
  15. /** \brief Major version number of the liblzma release. */
  16. #define LZMA_VERSION_MAJOR 5
  17. /** \brief Minor version number of the liblzma release. */
  18. #define LZMA_VERSION_MINOR 4
  19. /** \brief Patch version number of the liblzma release. */
  20. #define LZMA_VERSION_PATCH 2
  21. /**
  22. * \brief Version stability marker
  23. *
  24. * This will always be one of three values:
  25. * - LZMA_VERSION_STABILITY_ALPHA
  26. * - LZMA_VERSION_STABILITY_BETA
  27. * - LZMA_VERSION_STABILITY_STABLE
  28. */
  29. #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
  30. /** \brief Commit version number of the liblzma release */
  31. #ifndef LZMA_VERSION_COMMIT
  32. # define LZMA_VERSION_COMMIT ""
  33. #endif
  34. /*
  35. * Map symbolic stability levels to integers.
  36. */
  37. #define LZMA_VERSION_STABILITY_ALPHA 0
  38. #define LZMA_VERSION_STABILITY_BETA 1
  39. #define LZMA_VERSION_STABILITY_STABLE 2
  40. /**
  41. * \brief Compile-time version number
  42. *
  43. * The version number is of format xyyyzzzs where
  44. * - x = major
  45. * - yyy = minor
  46. * - zzz = revision
  47. * - s indicates stability: 0 = alpha, 1 = beta, 2 = stable
  48. *
  49. * The same xyyyzzz triplet is never reused with different stability levels.
  50. * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta
  51. * or 5.1.0 stable.
  52. *
  53. * \note The version number of liblzma has nothing to with
  54. * the version number of Igor Pavlov's LZMA SDK.
  55. */
  56. #define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \
  57. + LZMA_VERSION_MINOR * UINT32_C(10000) \
  58. + LZMA_VERSION_PATCH * UINT32_C(10) \
  59. + LZMA_VERSION_STABILITY)
  60. /*
  61. * Macros to construct the compile-time version string
  62. */
  63. #if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA
  64. # define LZMA_VERSION_STABILITY_STRING "alpha"
  65. #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA
  66. # define LZMA_VERSION_STABILITY_STRING "beta"
  67. #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE
  68. # define LZMA_VERSION_STABILITY_STRING ""
  69. #else
  70. # error Incorrect LZMA_VERSION_STABILITY
  71. #endif
  72. #define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \
  73. #major "." #minor "." #patch stability commit
  74. #define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \
  75. LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit)
  76. /**
  77. * \brief Compile-time version as a string
  78. *
  79. * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable
  80. * versions don't have any "stable" suffix). In future, a snapshot built
  81. * from source code repository may include an additional suffix, for example
  82. * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form
  83. * in LZMA_VERSION macro.
  84. */
  85. #define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \
  86. LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \
  87. LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \
  88. LZMA_VERSION_COMMIT)
  89. /* #ifndef is needed for use with windres (MinGW or Cygwin). */
  90. #ifndef LZMA_H_INTERNAL_RC
  91. /**
  92. * \brief Run-time version number as an integer
  93. *
  94. * This allows an application to compare if it was built against the same,
  95. * older, or newer version of liblzma that is currently running.
  96. *
  97. * \return The value of LZMA_VERSION macro at the compile time of liblzma
  98. */
  99. extern LZMA_API(uint32_t) lzma_version_number(void)
  100. lzma_nothrow lzma_attr_const;
  101. /**
  102. * \brief Run-time version as a string
  103. *
  104. * This function may be useful to display which version of liblzma an
  105. * application is currently using.
  106. *
  107. * \return Run-time version of liblzma
  108. */
  109. extern LZMA_API(const char *) lzma_version_string(void)
  110. lzma_nothrow lzma_attr_const;
  111. #endif