|
||||
File indexing completed on 2025-01-18 09:48:06
0001 /* 0002 Copyright Rene Rivera 2005-2016 0003 Distributed under the Boost Software License, Version 1.0. 0004 (See accompanying file LICENSE_1_0.txt or copy at 0005 http://www.boost.org/LICENSE_1_0.txt) 0006 */ 0007 0008 #ifndef BOOST_PREDEF_VERSION_NUMBER_H 0009 #define BOOST_PREDEF_VERSION_NUMBER_H 0010 0011 /* tag::reference[] 0012 = `BOOST_VERSION_NUMBER` 0013 0014 [source] 0015 ---- 0016 BOOST_VERSION_NUMBER(major,minor,patch) 0017 ---- 0018 0019 Defines standard version numbers, with these properties: 0020 0021 * Decimal base whole numbers in the range [0,1000000000). 0022 The number range is designed to allow for a (2,2,5) triplet. 0023 Which fits within a 32 bit value. 0024 * The `major` number can be in the [0,99] range. 0025 * The `minor` number can be in the [0,99] range. 0026 * The `patch` number can be in the [0,99999] range. 0027 * Values can be specified in any base. As the defined value 0028 is an constant expression. 0029 * Value can be directly used in both preprocessor and compiler 0030 expressions for comparison to other similarly defined values. 0031 * The implementation enforces the individual ranges for the 0032 major, minor, and patch numbers. And values over the ranges 0033 are truncated (modulo). 0034 0035 */ // end::reference[] 0036 #define BOOST_VERSION_NUMBER(major,minor,patch) \ 0037 ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) ) 0038 0039 #define BOOST_VERSION_NUMBER_MAX \ 0040 BOOST_VERSION_NUMBER(99,99,99999) 0041 0042 #define BOOST_VERSION_NUMBER_ZERO \ 0043 BOOST_VERSION_NUMBER(0,0,0) 0044 0045 #define BOOST_VERSION_NUMBER_MIN \ 0046 BOOST_VERSION_NUMBER(0,0,1) 0047 0048 #define BOOST_VERSION_NUMBER_AVAILABLE \ 0049 BOOST_VERSION_NUMBER_MIN 0050 0051 #define BOOST_VERSION_NUMBER_NOT_AVAILABLE \ 0052 BOOST_VERSION_NUMBER_ZERO 0053 0054 /* tag::reference[] 0055 [source] 0056 ---- 0057 BOOST_VERSION_NUMBER_MAJOR(N), BOOST_VERSION_NUMBER_MINOR(N), BOOST_VERSION_NUMBER_PATCH(N) 0058 ---- 0059 0060 The macros extract the major, minor, and patch portion from a well formed 0061 version number resulting in a preprocessor expression in the range of 0062 [0,99] or [0,99999] for the major and minor, or patch numbers 0063 respectively. 0064 */ // end::reference[] 0065 #define BOOST_VERSION_NUMBER_MAJOR(N) \ 0066 ( ((N)/10000000)%100 ) 0067 0068 #define BOOST_VERSION_NUMBER_MINOR(N) \ 0069 ( ((N)/100000)%100 ) 0070 0071 #define BOOST_VERSION_NUMBER_PATCH(N) \ 0072 ( (N)%100000 ) 0073 0074 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |