version_number.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. Copyright Rene Rivera 2005
  3. Copyright Redshift Software, Inc. 2008-2013
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifndef BOOST_PREDEF_VERSION_NUMBER_H
  9. #define BOOST_PREDEF_VERSION_NUMBER_H
  10. /*`
  11. [heading `BOOST_VERSION_NUMBER`]
  12. ``
  13. BOOST_VERSION_NUMBER(major,minor,patch)
  14. ``
  15. Defines standard version numbers, with these properties:
  16. * Decimal base whole numbers in the range \[0,1000000000).
  17. The number range is designed to allow for a (2,2,5) triplet.
  18. Which fits within a 32 bit value.
  19. * The `major` number can be in the \[0,99\] range.
  20. * The `minor` number can be in the \[0,99\] range.
  21. * The `patch` number can be in the \[0,99999\] range.
  22. * Values can be specified in any base. As the defined value
  23. is an constant expression.
  24. * Value can be directly used in both preprocessor and compiler
  25. expressions for comparison to other similarly defined values.
  26. * The implementation enforces the individual ranges for the
  27. major, minor, and patch numbers. And values over the ranges
  28. are truncated (modulo).
  29. */
  30. #define BOOST_VERSION_NUMBER(major,minor,patch) \
  31. ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) )
  32. #define BOOST_VERSION_NUMBER_MAX \
  33. BOOST_VERSION_NUMBER(99,99,99999)
  34. #define BOOST_VERSION_NUMBER_ZERO \
  35. BOOST_VERSION_NUMBER(0,0,0)
  36. #define BOOST_VERSION_NUMBER_MIN \
  37. BOOST_VERSION_NUMBER(0,0,1)
  38. #define BOOST_VERSION_NUMBER_AVAILABLE \
  39. BOOST_VERSION_NUMBER_MIN
  40. #define BOOST_VERSION_NUMBER_NOT_AVAILABLE \
  41. BOOST_VERSION_NUMBER_ZERO
  42. #endif