2010-05-22 20:20:04 +00:00
|
|
|
/*
|
2017-01-03 22:07:48 -06:00
|
|
|
Copyright Rene Rivera 2005-2016
|
2010-05-22 20:20:04 +00:00
|
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
|
|
|
(See accompanying file LICENSE_1_0.txt or copy at
|
|
|
|
|
http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
*/
|
2008-04-04 18:47:29 +00:00
|
|
|
|
2010-02-25 16:59:10 +00:00
|
|
|
#ifndef BOOST_PREDEF_VERSION_NUMBER_H
|
|
|
|
|
#define BOOST_PREDEF_VERSION_NUMBER_H
|
2008-04-04 18:47:29 +00:00
|
|
|
|
2019-12-31 16:14:17 -06:00
|
|
|
/* tag::reference[]
|
|
|
|
|
= `BOOST_VERSION_NUMBER`
|
2011-11-19 03:46:41 +00:00
|
|
|
|
2019-12-31 16:14:17 -06:00
|
|
|
[source]
|
|
|
|
|
----
|
2011-11-19 03:46:41 +00:00
|
|
|
BOOST_VERSION_NUMBER(major,minor,patch)
|
2019-12-31 16:14:17 -06:00
|
|
|
----
|
2011-11-19 03:46:41 +00:00
|
|
|
|
|
|
|
|
Defines standard version numbers, with these properties:
|
|
|
|
|
|
2019-12-31 16:14:17 -06:00
|
|
|
* Decimal base whole numbers in the range [0,1000000000).
|
2011-11-19 03:46:41 +00:00
|
|
|
The number range is designed to allow for a (2,2,5) triplet.
|
|
|
|
|
Which fits within a 32 bit value.
|
2019-12-31 16:14:17 -06:00
|
|
|
* The `major` number can be in the [0,99] range.
|
|
|
|
|
* The `minor` number can be in the [0,99] range.
|
|
|
|
|
* The `patch` number can be in the [0,99999] range.
|
2011-11-19 03:46:41 +00:00
|
|
|
* Values can be specified in any base. As the defined value
|
|
|
|
|
is an constant expression.
|
|
|
|
|
* Value can be directly used in both preprocessor and compiler
|
|
|
|
|
expressions for comparison to other similarly defined values.
|
|
|
|
|
* The implementation enforces the individual ranges for the
|
|
|
|
|
major, minor, and patch numbers. And values over the ranges
|
|
|
|
|
are truncated (modulo).
|
|
|
|
|
|
2019-12-31 16:14:17 -06:00
|
|
|
*/ // end::reference[]
|
2008-04-04 18:47:29 +00:00
|
|
|
#define BOOST_VERSION_NUMBER(major,minor,patch) \
|
2011-11-19 03:46:41 +00:00
|
|
|
( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) )
|
2008-04-04 18:47:29 +00:00
|
|
|
|
2013-01-18 21:25:30 -06:00
|
|
|
#define BOOST_VERSION_NUMBER_MAX \
|
|
|
|
|
BOOST_VERSION_NUMBER(99,99,99999)
|
|
|
|
|
|
|
|
|
|
#define BOOST_VERSION_NUMBER_ZERO \
|
|
|
|
|
BOOST_VERSION_NUMBER(0,0,0)
|
|
|
|
|
|
|
|
|
|
#define BOOST_VERSION_NUMBER_MIN \
|
|
|
|
|
BOOST_VERSION_NUMBER(0,0,1)
|
|
|
|
|
|
|
|
|
|
#define BOOST_VERSION_NUMBER_AVAILABLE \
|
|
|
|
|
BOOST_VERSION_NUMBER_MIN
|
|
|
|
|
|
|
|
|
|
#define BOOST_VERSION_NUMBER_NOT_AVAILABLE \
|
2013-08-11 13:32:58 -05:00
|
|
|
BOOST_VERSION_NUMBER_ZERO
|
2013-01-18 21:25:30 -06:00
|
|
|
|
2019-12-31 16:14:17 -06:00
|
|
|
/* tag::reference[]
|
|
|
|
|
[source]
|
|
|
|
|
----
|
2017-01-03 22:07:48 -06:00
|
|
|
BOOST_VERSION_NUMBER_MAJOR(N), BOOST_VERSION_NUMBER_MINOR(N), BOOST_VERSION_NUMBER_PATCH(N)
|
2019-12-31 16:14:17 -06:00
|
|
|
----
|
2017-01-03 22:07:48 -06:00
|
|
|
|
|
|
|
|
The macros extract the major, minor, and patch portion from a well formed
|
|
|
|
|
version number resulting in a preprocessor expression in the range of
|
2019-12-31 16:14:17 -06:00
|
|
|
[0,99] or [0,99999] for the major and minor, or patch numbers
|
2017-01-03 22:07:48 -06:00
|
|
|
respectively.
|
2019-12-31 16:14:17 -06:00
|
|
|
*/ // end::reference[]
|
2017-01-03 22:07:48 -06:00
|
|
|
#define BOOST_VERSION_NUMBER_MAJOR(N) \
|
|
|
|
|
( ((N)/10000000)%100 )
|
|
|
|
|
|
|
|
|
|
#define BOOST_VERSION_NUMBER_MINOR(N) \
|
|
|
|
|
( ((N)/100000)%100 )
|
|
|
|
|
|
|
|
|
|
#define BOOST_VERSION_NUMBER_PATCH(N) \
|
|
|
|
|
( (N)%100000 )
|
|
|
|
|
|
2008-04-04 18:47:29 +00:00
|
|
|
#endif
|