version.h 3.4 KB

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