1 //  Copyright (c) 2007-2017 Hartmut Kaiser
2 //  Copyright (c)      2011 Bryce Lelbach
3 //  Copyright (c)      2013 Adrian Serio
4 //
5 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
6 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 
8 // Make HPX inspect tool happy: hpxinspect:nounnamed
9 
10 #ifndef HPX_CONFIG_VERSION_HPP
11 #define HPX_CONFIG_VERSION_HPP
12 
13 #include <hpx/config.hpp>
14 #include <hpx/config/export_definitions.hpp>
15 #include <hpx/util/detail/pp/cat.hpp>
16 
17 #include <boost/version.hpp>
18 
19 ///////////////////////////////////////////////////////////////////////////////
20 //  The version of HPX
21 //
22 //  HPX_VERSION_FULL & 0x0000FF is the sub-minor version
23 //  HPX_VERSION_FULL & 0x00FF00 is the minor version
24 //  HPX_VERSION_FULL & 0xFF0000 is the major version
25 //
26 //  HPX_VERSION_DATE   YYYYMMDD is the date of the release
27 //                               (estimated release date for master branch)
28 //
29 #define HPX_VERSION_FULL         0x010201
30 
31 #define HPX_VERSION_MAJOR        1
32 #define HPX_VERSION_MINOR        2
33 #define HPX_VERSION_SUBMINOR     1
34 
35 #define HPX_VERSION_DATE         20190219
36 
37 #if !defined(HPX_AGAS_VERSION)
38     #define HPX_AGAS_VERSION 0x30
39 #endif
40 
41 #define HPX_VERSION_TAG          ""
42 
43 #if !defined(HPX_HAVE_GIT_COMMIT)
44     #define HPX_HAVE_GIT_COMMIT  "unknown"
45 #endif
46 
47 ///////////////////////////////////////////////////////////////////////////////
48 // The version check enforces the major and minor version numbers to match for
49 // every compilation unit to be compiled.
50 #define HPX_CHECK_VERSION                                                     \
51     HPX_PP_CAT(hpx_check_version_,                                            \
52         HPX_PP_CAT(HPX_VERSION_MAJOR,                                         \
53             HPX_PP_CAT(_, HPX_VERSION_MINOR)))                                \
54     /**/
55 
56 // The version check enforces the major and minor version numbers to match for
57 // every compilation unit to be compiled.
58 #define HPX_CHECK_BOOST_VERSION                                               \
59     HPX_PP_CAT(hpx_check_boost_version_, BOOST_VERSION)                       \
60     /**/
61 
62 ///////////////////////////////////////////////////////////////////////////////
63 namespace hpx
64 {
65     // Helper data structures allowing to automatically detect version problems
66     // between applications and the core libraries.
67     HPX_EXPORT extern char const HPX_CHECK_VERSION[];
68     HPX_EXPORT extern char const HPX_CHECK_BOOST_VERSION[];
69 }
70 
71 ///////////////////////////////////////////////////////////////////////////////
72 #if !defined(HPX_EXPORTS) && !defined(HPX_NO_VERSION_CHECK)
73     // This is instantiated for each translation unit outside of the HPX core
74     // library, forcing to resolve the variable HPX_CHECK_VERSION.
75     namespace
76     {
77         // Note: this function is never executed.
78 #if defined(__GNUG__)
79         __attribute__ ((unused))
80 #endif
check_hpx_version()81         char const* check_hpx_version()
82         {
83             char const* versions[] = {
84                 hpx::HPX_CHECK_VERSION, hpx::HPX_CHECK_BOOST_VERSION
85             };
86             return versions[0];
87         }
88     }
89 #endif
90 
91 #endif
92