mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
fix config macro name
This commit is contained in:
parent
d1379ff155
commit
1ed18456b3
13 changed files with 64 additions and 20 deletions
|
@ -47,6 +47,7 @@
|
||||||
# include <sprout/config/compiler/visualc.hpp>
|
# include <sprout/config/compiler/visualc.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sprout/config/compiler/cxx11.hpp>
|
#include <sprout/config/compiler/no_cxx11_future.hpp>
|
||||||
|
#include <sprout/config/compiler/has_future.hpp>
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_CONFIG_COMPILER_HPP
|
#endif // #ifndef SPROUT_CONFIG_COMPILER_HPP
|
||||||
|
|
29
sprout/config/compiler/has_future.hpp
Normal file
29
sprout/config/compiler/has_future.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef SPROUT_CONFIG_COMPILER_HAS_FUTURE_HPP
|
||||||
|
#define SPROUT_CONFIG_COMPILER_HAS_FUTURE_HPP
|
||||||
|
|
||||||
|
#ifndef SPROUT_NO_CONSTEXPR
|
||||||
|
# define SPROUT_HAS_CONSTEXPR
|
||||||
|
#endif
|
||||||
|
#ifndef SPROUT_NO_DEFAULTED_FUNCTIONS
|
||||||
|
# define SPROUT_HAS_DEFAULTED_FUNCTIONS
|
||||||
|
#endif
|
||||||
|
#ifndef SPROUT_NO_DELETED_FUNCTIONS
|
||||||
|
# define SPROUT_HAS_DELETED_FUNCTIONS
|
||||||
|
#endif
|
||||||
|
#ifndef SPROUT_NO_NOEXCEPT
|
||||||
|
# define SPROUT_HAS_NOEXCEPT
|
||||||
|
#endif
|
||||||
|
#ifndef SPROUT_NO_TEMPLATE_ALIASES
|
||||||
|
# define SPROUT_HAS_TEMPLATE_ALIASES
|
||||||
|
#endif
|
||||||
|
#ifndef SPROUT_NO_USER_DEFINED_LITERALS
|
||||||
|
# define SPROUT_HAS_USER_DEFINED_LITERALS
|
||||||
|
#endif
|
||||||
|
#ifndef SPROUT_NO_DELEGATING_CONSTRUCTORS
|
||||||
|
# define SPROUT_HAS_DELEGATING_CONSTRUCTORS
|
||||||
|
#endif
|
||||||
|
#ifndef SPROUT_NO_UNICODE_LITERALS
|
||||||
|
# define SPROUT_HAS_UNICODE_LITERALS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_CONFIG_COMPILER_HAS_FUTURE_HPP
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef SPROUT_CONFIG_COMPILER_CXX11_HPP
|
#ifndef SPROUT_CONFIG_COMPILER_NO_CXX11_FUTURE_HPP
|
||||||
#define SPROUT_CONFIG_COMPILER_CXX11_HPP
|
#define SPROUT_CONFIG_COMPILER_NO_CXX11_FUTURE_HPP
|
||||||
|
|
||||||
#ifdef SPROUT_NO_CONSTEXPR
|
#ifdef SPROUT_NO_CONSTEXPR
|
||||||
# define SPROUT_NO_CXX11_CONSTEXPR
|
# define SPROUT_NO_CXX11_CONSTEXPR
|
||||||
|
@ -11,19 +11,19 @@
|
||||||
# define SPROUT_NO_CXX11_DELETED_FUNCTIONS
|
# define SPROUT_NO_CXX11_DELETED_FUNCTIONS
|
||||||
#endif
|
#endif
|
||||||
#ifdef SPROUT_NO_NOEXCEPT
|
#ifdef SPROUT_NO_NOEXCEPT
|
||||||
# define SPROUT_NO_CXX11_CNOEXCEPT
|
# define SPROUT_NO_CXX11_NOEXCEPT
|
||||||
#endif
|
#endif
|
||||||
#ifdef SPROUT_NO_TEMPLATE_ALIASES
|
#ifdef SPROUT_NO_TEMPLATE_ALIASES
|
||||||
# define SPROUT_NO_CXX11_CTEMPLATE_ALIASES
|
# define SPROUT_NO_CXX11_TEMPLATE_ALIASES
|
||||||
#endif
|
#endif
|
||||||
#ifdef SPROUT_NO_USER_DEFINED_LITERALS
|
#ifdef SPROUT_NO_USER_DEFINED_LITERALS
|
||||||
# define SPROUT_NO_CXX11_CUSER_DEFINED_LITERALS
|
# define SPROUT_NO_CXX11_USER_DEFINED_LITERALS
|
||||||
#endif
|
#endif
|
||||||
#ifdef SPROUT_NO_DELEGATING_CONSTRUCTORS
|
#ifdef SPROUT_NO_DELEGATING_CONSTRUCTORS
|
||||||
# define SPROUT_NO_CXX11_CDELEGATING_CONSTRUCTORS
|
# define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS
|
||||||
#endif
|
#endif
|
||||||
#ifdef SPROUT_NO_UNICODE_LITERALS
|
#ifdef SPROUT_NO_UNICODE_LITERALS
|
||||||
# define SPROUT_NO_CXX11_UNICODE_LITERALS
|
# define SPROUT_NO_CXX11_UNICODE_LITERALS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_CONFIG_COMPILER_CXX11_HPP
|
#endif // #ifndef SPROUT_CONFIG_COMPILER_NO_CXX11_FUTURE_HPP
|
|
@ -85,11 +85,11 @@
|
||||||
# define SPROUT_USE_BUILTIN_BIT_OPERATION 0
|
# define SPROUT_USE_BUILTIN_BIT_OPERATION 0
|
||||||
#endif // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_BIT_OPERATION
|
#endif // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_BIT_OPERATION
|
||||||
|
|
||||||
#ifndef SPROUT_CONFIG_DISABLE_THROW_INT_CONVERSION_OVERFLOW
|
#ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING
|
||||||
# define SPROUT_NOTHROW_INT_CONVERSION_OVERFLOW 1
|
# define SPROUT_NOERROR_LARGE_FLOAT_ROUNDING 1
|
||||||
#else // #ifndef SPROUT_CONFIG_DISABLE_THROW_INT_CONVERSION_OVERFLOW
|
#else // #ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING
|
||||||
# define SPROUT_NOTHROW_INT_CONVERSION_OVERFLOW 0
|
# define SPROUT_NOERROR_LARGE_FLOAT_ROUNDING 0
|
||||||
#endif // #ifndef SPROUT_CONFIG_DISABLE_THROW_INT_CONVERSION_OVERFLOW
|
#endif // #ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING
|
||||||
|
|
||||||
#ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION
|
#ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION
|
||||||
# define SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION 1
|
# define SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION 1
|
||||||
|
|
|
@ -23,6 +23,10 @@ namespace sprout {
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
// 7.21.5.1 memchr ŠÖ<C5A0>”
|
// 7.21.5.1 memchr ŠÖ<C5A0>”
|
||||||
|
//
|
||||||
|
// recursion depth:
|
||||||
|
// O(log N)
|
||||||
|
//
|
||||||
inline SPROUT_CONSTEXPR void const*
|
inline SPROUT_CONSTEXPR void const*
|
||||||
memchr(void const* s, int c, std::size_t n) {
|
memchr(void const* s, int c, std::size_t n) {
|
||||||
return sprout::detail::memchr_impl(
|
return sprout::detail::memchr_impl(
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
// 7.21.4.1 memcmp ŠÖ<C5A0>”
|
// 7.21.4.1 memcmp ŠÖ<C5A0>”
|
||||||
|
//
|
||||||
|
// recursion depth:
|
||||||
|
// O(log(N1+N2))
|
||||||
|
//
|
||||||
inline SPROUT_CONSTEXPR int
|
inline SPROUT_CONSTEXPR int
|
||||||
memcmp(void const* s1, void const* s2, std::size_t n) {
|
memcmp(void const* s1, void const* s2, std::size_t n) {
|
||||||
return sprout::tristate_lexicographical_compare(
|
return sprout::tristate_lexicographical_compare(
|
||||||
|
|
|
@ -25,6 +25,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// wmemchr
|
// wmemchr
|
||||||
//
|
//
|
||||||
|
// recursion depth:
|
||||||
|
// O(log N)
|
||||||
|
//
|
||||||
inline SPROUT_CONSTEXPR wchar_t const*
|
inline SPROUT_CONSTEXPR wchar_t const*
|
||||||
wmemchr(wchar_t const* s, wchar_t c, size_t n) {
|
wmemchr(wchar_t const* s, wchar_t c, size_t n) {
|
||||||
return sprout::detail::wmemchr_impl(
|
return sprout::detail::wmemchr_impl(
|
||||||
|
|
|
@ -10,6 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// wmemcmp
|
// wmemcmp
|
||||||
//
|
//
|
||||||
|
// recursion depth:
|
||||||
|
// O(log(N1+N2))
|
||||||
|
//
|
||||||
inline SPROUT_CONSTEXPR int
|
inline SPROUT_CONSTEXPR int
|
||||||
wmemcmp(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
wmemcmp(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||||
return sprout::tristate_lexicographical_compare(
|
return sprout::tristate_lexicographical_compare(
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace sprout {
|
||||||
ceil(FloatType x) {
|
ceil(FloatType x) {
|
||||||
return sprout::math::isinf(x) ? x
|
return sprout::math::isinf(x) ? x
|
||||||
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
||||||
? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("ceil: Sorry, not implemented."), x)
|
? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("ceil: large float rounding."), x)
|
||||||
: x < 0 ? -static_cast<FloatType>(static_cast<std::uintmax_t>(-x))
|
: x < 0 ? -static_cast<FloatType>(static_cast<std::uintmax_t>(-x))
|
||||||
: sprout::math::detail::ceil_impl(x, static_cast<FloatType>(static_cast<std::uintmax_t>(x)))
|
: sprout::math::detail::ceil_impl(x, static_cast<FloatType>(static_cast<std::uintmax_t>(x)))
|
||||||
;
|
;
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
# define NS_SPROUT_MATH_DETAIL sprout::math::detail
|
# define NS_SPROUT_MATH_DETAIL sprout::math::detail
|
||||||
#endif // #ifndef SPROUT_USE_BUILTIN_CMATH_FUNCTION
|
#endif // #ifndef SPROUT_USE_BUILTIN_CMATH_FUNCTION
|
||||||
|
|
||||||
#if SPROUT_NOTHROW_INT_CONVERSION_OVERFLOW
|
#if SPROUT_NOERROR_LARGE_FLOAT_ROUNDING
|
||||||
# define SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(e, x) (x)
|
# define SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(e, x) (x)
|
||||||
#else
|
#else
|
||||||
# define SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(e, x) throw (e)
|
# define SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(e, x) throw (e)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_MATH_DETAIL_CONFIG_HPP
|
#endif // #ifndef SPROUT_MATH_DETAIL_CONFIG_HPP
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace sprout {
|
||||||
floor(FloatType x) {
|
floor(FloatType x) {
|
||||||
return sprout::math::isinf(x) ? x
|
return sprout::math::isinf(x) ? x
|
||||||
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
||||||
? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("floor: Sorry, not implemented."), x)
|
? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("floor: large float rounding."), x)
|
||||||
: x < 0 ? sprout::math::detail::floor_impl(x, -static_cast<FloatType>(static_cast<std::uintmax_t>(-x)))
|
: x < 0 ? sprout::math::detail::floor_impl(x, -static_cast<FloatType>(static_cast<std::uintmax_t>(-x)))
|
||||||
: static_cast<FloatType>(static_cast<std::uintmax_t>(x))
|
: static_cast<FloatType>(static_cast<std::uintmax_t>(x))
|
||||||
;
|
;
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace sprout {
|
||||||
round(FloatType x) {
|
round(FloatType x) {
|
||||||
return sprout::math::isinf(x) ? x
|
return sprout::math::isinf(x) ? x
|
||||||
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
||||||
? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("round: Sorry, not implemented."), x)
|
? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("round: large float rounding."), x)
|
||||||
: x < 0 ? sprout::math::detail::round_impl_nagative(x, -static_cast<FloatType>(static_cast<std::uintmax_t>(-x)))
|
: x < 0 ? sprout::math::detail::round_impl_nagative(x, -static_cast<FloatType>(static_cast<std::uintmax_t>(-x)))
|
||||||
: sprout::math::detail::round_impl_positive(x, static_cast<FloatType>(static_cast<std::uintmax_t>(x)))
|
: sprout::math::detail::round_impl_positive(x, static_cast<FloatType>(static_cast<std::uintmax_t>(x)))
|
||||||
;
|
;
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace sprout {
|
||||||
trunc(FloatType x) {
|
trunc(FloatType x) {
|
||||||
return sprout::math::isinf(x) ? x
|
return sprout::math::isinf(x) ? x
|
||||||
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
: std::numeric_limits<std::uintmax_t>::max() < x || std::numeric_limits<std::uintmax_t>::max() < -x
|
||||||
? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("trunc: Sorry, not implemented."), x)
|
? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("trunc: large float rounding."), x)
|
||||||
: x < 0 ? -static_cast<FloatType>(static_cast<std::uintmax_t>(-x))
|
: x < 0 ? -static_cast<FloatType>(static_cast<std::uintmax_t>(-x))
|
||||||
: static_cast<FloatType>(static_cast<std::uintmax_t>(x))
|
: static_cast<FloatType>(static_cast<std::uintmax_t>(x))
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in a new issue