version_number.h 1.5 KB

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