version.h.in 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright © 2010 Stéphane Raimbault <stephane.raimbault@gmail.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _MB_VERSION_H_
  18. #define _MB_VERSION_H_
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /* The major version of libmb, (1, if %MB_VERSION is 1.2.3) */
  23. #define MB_VERSION_MAJOR (@MB_VERSION_MAJOR@)
  24. /* The minor version of libmb (2, if %MB_VERSION is 1.2.3) */
  25. #define MB_VERSION_MINOR (@MB_VERSION_MINOR@)
  26. /* The micro version of libmb (3, if %MB_VERSION is 1.2.3) */
  27. #define MB_VERSION_MICRO (@MB_VERSION_MICRO@)
  28. /* The full version of libmb, like 1.2.3 */
  29. #define MB_VERSION @MB_VERSION@
  30. /* The full version of libmb, in string form (suited for
  31. * string concatenation)
  32. */
  33. #define MB_VERSION_STRING "@MB_VERSION@"
  34. /* Numerically encoded version libmb, like 0x010203 */
  35. #define MB_VERSION_HEX ((MB_MAJOR_VERSION << 24) | \
  36. (MB_MINOR_VERSION << 16) | \
  37. (MB_MICRO_VERSION << 8))
  38. /* Evaluates to True if the version of libmb is greater than @major, @minor
  39. * and @micro
  40. */
  41. #define MB_VERSION_CHECK(major,minor,micro) \
  42. (MB_VERSION_MAJOR > (major) || \
  43. (MB_VERSION_MAJOR == (major) && MB_VERSION_MINOR > (minor)) || \
  44. (MB_VERSION_MAJOR == (major) && MB_VERSION_MINOR == (minor) && MB_VERSION_MICRO >= (micro)))
  45. extern const unsigned int mb_version_major;
  46. extern const unsigned int mb_version_minor;
  47. extern const unsigned int mb_version_micro;
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif /* _MB_VERSION_H_ */