Update config, fix checks

This commit is contained in:
Krystian Stasiowski
2020-02-01 21:19:29 -05:00
parent c34bd74d69
commit 2fe445f634
4 changed files with 66 additions and 29 deletions

View File

@ -33,8 +33,15 @@
#endif
// Can we use is_constant_evaluated?
// Standard version
#if __cpp_lib_is_constant_evaluated >= 201811L
#define BOOST_STATIC_STRING_USE_IS_CONST_EVAL
#define BOOST_STATIC_STRING_IS_CONST_EVAL std::is_constant_evaluated()
#elif defined(__clang__) && (__clang_major__ > 8)
// If we have clang version 9+, we can use the intrinsic
// While gcc also has this, we don't need it
#define BOOST_STATIC_STRING_USE_IS_CONST_EVAL
#define BOOST_STATIC_STRING_IS_CONST_EVAL __builtin_is_constant_evaluated()
#endif
// Can we use [[nodiscard]]?
@ -56,36 +63,35 @@
#endif
#if BOOST_STATIC_STRING_STANDARD_VERSION > 201703L
#define BOOST_STATIC_STRING_CPP20
#define BOOST_STATIC_STRING_CPP17
#define BOOST_STATIC_STRING_CPP14
#define BOOST_STATIC_STRING_CPP11
#define BOOST_STATIC_STRING_CPP20_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP17_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP20_CONSTEXPR_USED
#define BOOST_STATIC_STRING_CPP17_CONSTEXPR_USED
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR_USED
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR_USED
#define BOOST_STATIC_STRING_ALLOW_UNINIT_MEM
#elif BOOST_STATIC_STRING_STANDARD_VERSION >= 201703L
#define BOOST_STATIC_STRING_CPP17
#define BOOST_STATIC_STRING_CPP14
#define BOOST_STATIC_STRING_CPP11
#define BOOST_STATIC_STRING_CPP20_CONSTEXPR
#define BOOST_STATIC_STRING_CPP17_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP17_CONSTEXPR_USED
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR_USED
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR_USED
#elif BOOST_STATIC_STRING_STANDARD_VERSION >= 201402L
#define BOOST_STATIC_STRING_CPP14
#define BOOST_STATIC_STRING_CPP11
#define BOOST_STATIC_STRING_CPP20_CONSTEXPR
#define BOOST_STATIC_STRING_CPP17_CONSTEXPR
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR_USED
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR_USED
#else
#define BOOST_STATIC_STRING_CPP11
#define BOOST_STATIC_STRING_CPP20_CONSTEXPR
#define BOOST_STATIC_STRING_CPP17_CONSTEXPR
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR constexpr
#define BOOST_STATIC_STRING_CPP11_CONSTEXPR_USED
#endif
#ifdef BOOST_STATIC_STRING_NO_EXCEPTIONS
@ -127,19 +133,25 @@
// Compiler bug prevents constexpr from working with clang 4.x and 5.x
// if it is detected, we disable constexpr
#if (BOOST_STATIC_STRING_STANDARD_VERSION >= 201402L) && \
(BOOST_STATIC_STRING_STANDARD_VERSION < 201703L) && \
#if (BOOST_STATIC_STRING_STANDARD_VERSION >= 201402L && \
BOOST_STATIC_STRING_STANDARD_VERSION < 201703L) && \
defined(__clang__) && \
((__clang_major__ == 4) || (__clang_major__ == 5))
// This directive works on clang
#warning "C++14 constexpr is not supported in clang 4.x and 5.x due to a compiler bug."
#ifdef BOOST_STATIC_STRING_CPP14_CONSTEXPR_USED
#undef BOOST_STATIC_STRING_CPP14_CONSTEXPR_USED
#ifdef BOOST_STATIC_STRING_CPP14
#undef BOOST_STATIC_STRING_CPP14
#endif
#undef BOOST_STATIC_STRING_CPP14_CONSTEXPR
#define BOOST_STATIC_STRING_CPP14_CONSTEXPR
#endif
//(defined(_MSVC_LANG) && BOOST_STATIC_STRING_STANDARD_VERSION < 201703L)
#if (defined(__clang__) && (__clang_major__ < 9)) || \
(defined(_MSVC_LANG) && !defined(BOOST_STATIC_STRING_CPP20))
#define BOOST_STATIC_STRING_NO_PTR_COMP_FUNCTIONS
#endif
#ifndef BOOST_STATIC_STRING_STANDALONE
#include <boost/assert.hpp>
#include <boost/container_hash/hash.hpp>