// Copyright (c) 2007-2024 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2013 Adrian Serio // // SPDX-License-Identifier: BSL-1.0 // 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) // Do not edit this file! It has been generated by the cmake configuration step. // Make HPX inspect tool happy: hpxinspect:nounnamed #pragma once #include #include #include #include /// Evaluates to the major version of HPX #define HPX_VERSION_MAJOR @HPX_VERSION_MAJOR@ /// Evaluates to the minor version of HPX #define HPX_VERSION_MINOR @HPX_VERSION_MINOR@ /// Evaluates to the subminor version of HPX #define HPX_VERSION_SUBMINOR @HPX_VERSION_SUBMINOR@ /// Evaluates to the HPX version: /// ``HPX_VERSION_FULL & 0xFF0000 == HPX_VERSION_MAJOR`` /// ``HPX_VERSION_FULL & 0x00FF00 == HPX_VERSION_MINOR`` /// ``HPX_VERSION_FULL & 0x0000FF == HPX_VERSION_SUBMINOR`` #define HPX_VERSION_FULL \ ((HPX_PP_CAT(0x, HPX_VERSION_MAJOR) << 16) | \ (HPX_PP_CAT(0x, HPX_VERSION_MINOR) << 8) | \ HPX_PP_CAT(0x, HPX_VERSION_SUBMINOR)) /// Evaluates to the release date of this HPX version in the format YYYYMMDD. #define HPX_VERSION_DATE @HPX_VERSION_DATE@ /// Evaluates to the version tag (empty for releases, ``-trunk`` on the /// development branch, ``-rcX`` on a release candidate. #define HPX_VERSION_TAG "@HPX_VERSION_TAG@" #if !defined(HPX_AGAS_VERSION) #define HPX_AGAS_VERSION 0x30 #endif #if !defined(HPX_HAVE_GIT_COMMIT) #define HPX_HAVE_GIT_COMMIT "unknown" #endif /////////////////////////////////////////////////////////////////////////////// // The name of the symbol the version check refers to, it holds the full // version (for instance hpx_check_version_2_1_0): HPX keeps no ABI // compatibility between releases. #define HPX_CHECK_VERSION \ HPX_PP_CAT(hpx_check_version_, \ HPX_PP_CAT(HPX_VERSION_MAJOR, \ HPX_PP_CAT(_, \ HPX_PP_CAT(HPX_VERSION_MINOR, \ HPX_PP_CAT(_, HPX_VERSION_SUBMINOR))))) \ /**/ // The version check enforces the major and minor version numbers to match for // every compilation unit to be compiled. #define HPX_CHECK_BOOST_VERSION \ HPX_PP_CAT(hpx_check_boost_version_, BOOST_VERSION) \ /**/ /////////////////////////////////////////////////////////////////////////////// namespace hpx { // Helper data structures allowing to automatically detect version problems // between applications and the core libraries. C linkage keeps the symbol // name undecorated for the linker directive below. HPX_CXX_CORE_EXPORT extern "C" HPX_CORE_EXPORT char const HPX_CHECK_VERSION[]; HPX_CORE_EXPORT extern char const HPX_CHECK_BOOST_VERSION[]; } // namespace hpx /////////////////////////////////////////////////////////////////////////////// #if !defined(HPX_CORE_EXPORTS) && !defined(HPX_NO_VERSION_CHECK) // Every binary built from a translation unit outside the HPX core library // refers to HPX_CHECK_VERSION. Such a binary doesn't load with the core // library of another release (the loader reports the missing symbol), instead // of running with a mismatched ABI. The reference has to survive optimization. #if defined(_MSC_VER) // MSVC has no attribute that keeps an unreferenced variable: let the linker // include the symbol instead (32-bit x86 prefixes C names with '_') #if defined(_M_IX86) #define HPX_CHECK_VERSION_SYMBOL "_" HPX_PP_STRINGIZE(HPX_CHECK_VERSION) #else #define HPX_CHECK_VERSION_SYMBOL HPX_PP_STRINGIZE(HPX_CHECK_VERSION) #endif #if !defined(HPX_MODULE_STATIC_LINKING) && !defined(HPX_HAVE_STATIC_LINKING) #pragma comment(linker, "/include:__imp_" HPX_CHECK_VERSION_SYMBOL) #else #pragma comment(linker, "/include:" HPX_CHECK_VERSION_SYMBOL) #endif #undef HPX_CHECK_VERSION_SYMBOL #elif defined(__GNUC__) || defined(__clang__) // 'used' keeps the variable from the compiler, 'retain' (ELF only) keeps its // section from the linker's garbage collection (--gc-sections) #if defined(__ELF__) && defined(__has_attribute) #if __has_attribute(retain) #define HPX_CHECK_VERSION_KEEP __attribute__((used, retain)) #endif #endif #if !defined(HPX_CHECK_VERSION_KEEP) #define HPX_CHECK_VERSION_KEEP __attribute__((used)) #endif namespace { HPX_CHECK_VERSION_KEEP char const* const hpx_check_version_reference = hpx::HPX_CHECK_VERSION; } // namespace #undef HPX_CHECK_VERSION_KEEP #endif #endif