1 /*! 2 @file 3 Defines macros for tracking the version of the library. 4 5 @copyright Louis Dionne 2013-2017 6 Distributed under the Boost Software License, Version 1.0. 7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 8 */ 9 10 #ifndef BOOST_HANA_VERSION_HPP 11 #define BOOST_HANA_VERSION_HPP 12 13 //! @internal 14 //! Transforms a (version, revision, patchlevel) triple into a number of the 15 //! form 0xVVRRPPPP to allow comparing versions in a normalized way. 16 //! 17 //! See http://sourceforge.net/p/predef/wiki/VersionNormalization. 18 #define BOOST_HANA_CONFIG_VERSION(version, revision, patch) \ 19 (((version) << 24) + ((revision) << 16) + (patch)) 20 21 //! @ingroup group-config 22 //! Macro expanding to the major version of the library, i.e. the `x` in `x.y.z`. 23 #define BOOST_HANA_MAJOR_VERSION 1 24 25 //! @ingroup group-config 26 //! Macro expanding to the minor version of the library, i.e. the `y` in `x.y.z`. 27 #define BOOST_HANA_MINOR_VERSION 6 28 29 //! @ingroup group-config 30 //! Macro expanding to the patch level of the library, i.e. the `z` in `x.y.z`. 31 #define BOOST_HANA_PATCH_VERSION 0 32 33 //! @ingroup group-config 34 //! Macro expanding to the full version of the library, in hexadecimal 35 //! representation. 36 //! 37 //! Specifically, `BOOST_HANA_VERSION` expands to an hexadecimal number of the 38 //! form 0xVVRRPPPP, where `VV` is the major version of the library, `RR` is 39 //! the minor version and `PPPP` is the patch level. This allows the version 40 //! of the library to be compared: 41 //! @snippet example/version.cpp main 42 //! 43 //! 44 //! @note 45 //! The major, minor and patch versions of the library are also available 46 //! individually with the `BOOST_HANA_{MAJOR,MINOR,PATCH}_VERSION` macros. 47 #define BOOST_HANA_VERSION \ 48 BOOST_HANA_CONFIG_VERSION(BOOST_HANA_MAJOR_VERSION, \ 49 BOOST_HANA_MINOR_VERSION, \ 50 BOOST_HANA_PATCH_VERSION) \ 51 /**/ 52 53 #endif // !BOOST_HANA_VERSION_HPP 54