diff --git a/sprout/config/auto_config.hpp b/sprout/config/auto_config.hpp index 121e430d..53da5c42 100644 --- a/sprout/config/auto_config.hpp +++ b/sprout/config/auto_config.hpp @@ -2,6 +2,7 @@ #define SPROUT_CONFIG_AUTO_CONFIG_HPP #include +#include // // SPROUT_CONFIG_DISABLE_CONSTEXPR diff --git a/sprout/config/compiler/borland.hpp b/sprout/config/compiler/borland.hpp index a54ad28a..9d579ef7 100644 --- a/sprout/config/compiler/borland.hpp +++ b/sprout/config/compiler/borland.hpp @@ -4,7 +4,7 @@ #define SPROUT_NO_CXX11_CONSTEXPR #define SPROUT_NO_CXX11_DEFAULTED_FUNCTIONS #define SPROUT_NO_CXX11_DELETED_FUNCTIONS -#if !defined(BOOST_CODEGEAR_0X_SUPPORT) || (__BORLANDC__ < 0x610) +#if !defined(SPROUT_CODEGEAR_0X_SUPPORT) || (__BORLANDC__ < 0x610) # define SPROUT_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #endif #define SPROUT_NO_CXX11_NOEXCEPT diff --git a/sprout/config/config.hpp b/sprout/config/config.hpp index 1c9fa0f0..febcff94 100644 --- a/sprout/config/config.hpp +++ b/sprout/config/config.hpp @@ -6,6 +6,7 @@ #endif // #ifndef SPROUT_CONFIG_DISABLE_AUTO_CONFIG #include +#include #include #endif // #ifndef SPROUT_CONFIG_CONFIG_HPP diff --git a/sprout/config/stdlib.hpp b/sprout/config/stdlib.hpp new file mode 100644 index 00000000..4bc53581 --- /dev/null +++ b/sprout/config/stdlib.hpp @@ -0,0 +1,37 @@ +#ifndef SPROUT_CONFIG_STDLIB_HPP +#define SPROUT_CONFIG_STDLIB_HPP + +#ifdef __cplusplus +# include +#else +# include +#endif + +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +# include +#else + +# include + +# if defined(__LIBCOMO__) +# include +# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) +# include +# elif defined(_LIBCPP_VERSION) +# include +# elif defined(__GLIBCPP__) || defined(__GLIBCXX__) +# include +# elif defined(__STL_CONFIG_H) +# include +# elif defined(__MSL_CPP__) +# include +# elif defined(__IBMCPP__) +# include +# elif defined(MSIPL_COMPILE_H) +# include +# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) +# include +# endif +#endif + +#endif // #ifndef SPROUT_CONFIG_STDLIB_HPP diff --git a/sprout/config/stdlib/dinkumware.hpp b/sprout/config/stdlib/dinkumware.hpp new file mode 100644 index 00000000..75ca44dc --- /dev/null +++ b/sprout/config/stdlib/dinkumware.hpp @@ -0,0 +1,39 @@ +#ifndef SPROUT_CONFIG_STDLIB_DINKUMWARE_HPP +#define SPROUT_CONFIG_STDLIB_DINKUMWARE_HPP + +#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520 +# define SPROUT_NO_CXX11_HDR_ARRAY +# define SPROUT_NO_CXX11_HDR_CODECVT +# define SPROUT_NO_CXX11_HDR_FORWARD_LIST +# define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +# define SPROUT_NO_CXX11_HDR_RANDOM +# define SPROUT_NO_CXX11_HDR_REGEX +# define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +# define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +# define SPROUT_NO_CXX11_HDR_UNORDERED_SET +# define SPROUT_NO_CXX11_HDR_TUPLE +# define SPROUT_NO_CXX11_HDR_TYPEINDEX +# define SPROUT_NO_CXX11_HDR_FUNCTIONAL +# define SPROUT_NO_CXX11_NUMERIC_LIMITS +# define SPROUT_NO_CXX11_SMART_PTR +#endif + +#if (!defined(_HAS_TR1_IMPORTS) || (_HAS_TR1_IMPORTS+0 == 0)) && !defined(SPROUT_NO_CXX11_HDR_TUPLE) +# define SPROUT_NO_CXX11_HDR_TUPLE +#endif + +#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 540 +# define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +# define SPROUT_NO_CXX11_HDR_CHRONO +# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +# define SPROUT_NO_CXX11_HDR_FUTURE +# define SPROUT_NO_CXX11_HDR_MUTEX +# define SPROUT_NO_CXX11_HDR_RATIO +# define SPROUT_NO_CXX11_HDR_THREAD +# define SPROUT_NO_CXX11_ALLOCATOR +# define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#endif + +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST + +#endif // #ifndef SPROUT_CONFIG_STDLIB_DINKUMWARE_HPP diff --git a/sprout/config/stdlib/libcomo.hpp b/sprout/config/stdlib/libcomo.hpp new file mode 100644 index 00000000..a57fad0e --- /dev/null +++ b/sprout/config/stdlib/libcomo.hpp @@ -0,0 +1,28 @@ +#ifndef SPROUT_CONFIG_STDLIB_LIBCOMO_HPP +#define SPROUT_CONFIG_STDLIB_LIBCOMO_HPP + +#define SPROUT_NO_CXX11_HDR_ARRAY +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +#define SPROUT_NO_CXX11_HDR_FORWARD_LIST +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +#define SPROUT_NO_CXX11_HDR_MUTEX +#define SPROUT_NO_CXX11_HDR_RANDOM +#define SPROUT_NO_CXX11_HDR_RATIO +#define SPROUT_NO_CXX11_HDR_REGEX +#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TUPLE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_TYPEINDEX +#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +#define SPROUT_NO_CXX11_HDR_UNORDERED_SET +#define SPROUT_NO_CXX11_NUMERIC_LIMITS +#define SPROUT_NO_CXX11_ALLOCATOR +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#define SPROUT_NO_CXX11_SMART_PTR +#define SPROUT_NO_CXX11_HDR_FUNCTIONAL + +#endif // #ifndef SPROUT_CONFIG_STDLIB_LIBCOMO_HPP diff --git a/sprout/config/stdlib/libcpp.hpp b/sprout/config/stdlib/libcpp.hpp new file mode 100644 index 00000000..ab90e833 --- /dev/null +++ b/sprout/config/stdlib/libcpp.hpp @@ -0,0 +1,18 @@ +#ifndef SPROUT_CONFIG_STDLIB_LIBCPP_HPP +#define SPROUT_CONFIG_STDLIB_LIBCPP_HPP + +#ifdef _LIBCPP_HAS_NO_VARIADICS +# define SPROUT_NO_CXX11_HDR_TUPLE +#endif + +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR + +#include +#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 1101) +# define SPROUT_NO_CXX11_CHAR_TRAITS +#endif + +#endif // #ifndef SPROUT_CONFIG_STDLIB_LIBCPP_HPP diff --git a/sprout/config/stdlib/libstdcpp3.hpp b/sprout/config/stdlib/libstdcpp3.hpp new file mode 100644 index 00000000..f73b4da7 --- /dev/null +++ b/sprout/config/stdlib/libstdcpp3.hpp @@ -0,0 +1,48 @@ +#ifndef SPROUT_CONFIG_STDLIB_LIBSTDCPP3_HPP +#define SPROUT_CONFIG_STDLIB_LIBSTDCPP3_HPP + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define SPROUT_NO_CXX11_HDR_ARRAY +# define SPROUT_NO_CXX11_HDR_REGEX +# define SPROUT_NO_CXX11_HDR_TUPLE +# define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +# define SPROUT_NO_CXX11_HDR_UNORDERED_SET +# define SPROUT_NO_CXX11_HDR_FUNCTIONAL +#endif + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +# define SPROUT_NO_CXX11_HDR_FORWARD_LIST +# define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +# define SPROUT_NO_CXX11_HDR_MUTEX +# define SPROUT_NO_CXX11_HDR_RATIO +# define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +# define SPROUT_NO_CXX11_SMART_PTR +#endif + +#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(SPROUT_NO_CXX11_HDR_MUTEX)) +# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +# define SPROUT_NO_CXX11_HDR_MUTEX +#endif + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define SPROUT_NO_CXX11_NUMERIC_LIMITS +# define SPROUT_NO_CXX11_HDR_FUTURE +# define SPROUT_NO_CXX11_HDR_RANDOM +#endif + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define SPROUT_NO_CXX11_HDR_TYPEINDEX +#endif + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define SPROUT_NO_CXX11_HDR_CHRONO +# define SPROUT_NO_CXX11_ALLOCATOR +#endif + +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR + +#endif // #ifndef SPROUT_CONFIG_STDLIB_LIBSTDCPP3_HPP diff --git a/sprout/config/stdlib/modena.hpp b/sprout/config/stdlib/modena.hpp new file mode 100644 index 00000000..d7ae327e --- /dev/null +++ b/sprout/config/stdlib/modena.hpp @@ -0,0 +1,28 @@ +#ifndef SPROUT_CONFIG_STDLIB_MODENA_HPP +#define SPROUT_CONFIG_STDLIB_MODENA_HPP + +#define SPROUT_NO_CXX11_HDR_ARRAY +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +#define SPROUT_NO_CXX11_HDR_FORWARD_LIST +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +#define SPROUT_NO_CXX11_HDR_MUTEX +#define SPROUT_NO_CXX11_HDR_RANDOM +#define SPROUT_NO_CXX11_HDR_RATIO +#define SPROUT_NO_CXX11_HDR_REGEX +#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TUPLE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_TYPEINDEX +#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +#define SPROUT_NO_CXX11_HDR_UNORDERED_SET +#define SPROUT_NO_CXX11_NUMERIC_LIMITS +#define SPROUT_NO_CXX11_ALLOCATOR +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#define SPROUT_NO_CXX11_SMART_PTR +#define SPROUT_NO_CXX11_HDR_FUNCTIONAL + +#endif // #ifndef SPROUT_CONFIG_STDLIB_MODENA_HPP diff --git a/sprout/config/stdlib/msl.hpp b/sprout/config/stdlib/msl.hpp new file mode 100644 index 00000000..1a5af599 --- /dev/null +++ b/sprout/config/stdlib/msl.hpp @@ -0,0 +1,28 @@ +#ifndef SPROUT_CONFIG_STDLIB_MSL_HPP +#define SPROUT_CONFIG_STDLIB_MSL_HPP + +#define SPROUT_NO_CXX11_HDR_ARRAY +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +#define SPROUT_NO_CXX11_HDR_FORWARD_LIST +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +#define SPROUT_NO_CXX11_HDR_MUTEX +#define SPROUT_NO_CXX11_HDR_RANDOM +#define SPROUT_NO_CXX11_HDR_RATIO +#define SPROUT_NO_CXX11_HDR_REGEX +#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TUPLE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_TYPEINDEX +#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +#define SPROUT_NO_CXX11_HDR_UNORDERED_SET +#define SPROUT_NO_CXX11_NUMERIC_LIMITS +#define SPROUT_NO_CXX11_ALLOCATOR +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#define SPROUT_NO_CXX11_SMART_PTR +#define SPROUT_NO_CXX11_HDR_FUNCTIONAL + +#endif // #ifndef SPROUT_CONFIG_STDLIB_MSL_HPP diff --git a/sprout/config/stdlib/roguewave.hpp b/sprout/config/stdlib/roguewave.hpp new file mode 100644 index 00000000..282b3ceb --- /dev/null +++ b/sprout/config/stdlib/roguewave.hpp @@ -0,0 +1,31 @@ +#ifndef SPROUT_CONFIG_STDLIB_ROGUEWAVE_HPP +#define SPROUT_CONFIG_STDLIB_ROGUEWAVE_HPP + +#if _RWSTD_VER < 0x05000000 +# define SPROUT_NO_CXX11_HDR_ARRAY +#endif + +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +#define SPROUT_NO_CXX11_HDR_FORWARD_LIST +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +#define SPROUT_NO_CXX11_HDR_MUTEX +#define SPROUT_NO_CXX11_HDR_RANDOM +#define SPROUT_NO_CXX11_HDR_RATIO +#define SPROUT_NO_CXX11_HDR_REGEX +#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TUPLE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_TYPEINDEX +#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +#define SPROUT_NO_CXX11_HDR_UNORDERED_SET +#define SPROUT_NO_CXX11_NUMERIC_LIMITS +#define SPROUT_NO_CXX11_ALLOCATOR +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#define SPROUT_NO_CXX11_SMART_PTR +#define SPROUT_NO_CXX11_HDR_FUNCTIONAL + +#endif // #ifndef SPROUT_CONFIG_STDLIB_ROGUEWAVE_HPP diff --git a/sprout/config/stdlib/sgi.hpp b/sprout/config/stdlib/sgi.hpp new file mode 100644 index 00000000..cfb3a0a6 --- /dev/null +++ b/sprout/config/stdlib/sgi.hpp @@ -0,0 +1,28 @@ +#ifndef SPROUT_CONFIG_STDLIB_SGI_HPP +#define SPROUT_CONFIG_STDLIB_SGI_HPP + +#define SPROUT_NO_CXX11_HDR_ARRAY +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +#define SPROUT_NO_CXX11_HDR_FORWARD_LIST +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +#define SPROUT_NO_CXX11_HDR_MUTEX +#define SPROUT_NO_CXX11_HDR_RANDOM +#define SPROUT_NO_CXX11_HDR_RATIO +#define SPROUT_NO_CXX11_HDR_REGEX +#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TUPLE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_TYPEINDEX +#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +#define SPROUT_NO_CXX11_HDR_UNORDERED_SET +#define SPROUT_NO_CXX11_NUMERIC_LIMITS +#define SPROUT_NO_CXX11_ALLOCATOR +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#define SPROUT_NO_CXX11_SMART_PTR +#define SPROUT_NO_CXX11_HDR_FUNCTIONAL + +#endif // #ifndef SPROUT_CONFIG_STDLIB_SGI_HPP diff --git a/sprout/config/stdlib/stlport.hpp b/sprout/config/stdlib/stlport.hpp new file mode 100644 index 00000000..0e028b17 --- /dev/null +++ b/sprout/config/stdlib/stlport.hpp @@ -0,0 +1,28 @@ +#ifndef SPROUT_CONFIG_STDLIB_STLPORT_HPP +#define SPROUT_CONFIG_STDLIB_STLPORT_HPP + +#define SPROUT_NO_CXX11_HDR_ARRAY +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +#define SPROUT_NO_CXX11_HDR_FORWARD_LIST +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +#define SPROUT_NO_CXX11_HDR_MUTEX +#define SPROUT_NO_CXX11_HDR_RANDOM +#define SPROUT_NO_CXX11_HDR_RATIO +#define SPROUT_NO_CXX11_HDR_REGEX +#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TUPLE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_TYPEINDEX +#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +#define SPROUT_NO_CXX11_HDR_UNORDERED_SET +#define SPROUT_NO_CXX11_NUMERIC_LIMITS +#define SPROUT_NO_CXX11_ALLOCATOR +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#define SPROUT_NO_CXX11_SMART_PTR +#define SPROUT_NO_CXX11_HDR_FUNCTIONAL + +#endif // #ifndef SPROUT_CONFIG_STDLIB_STLPORT_HPP diff --git a/sprout/config/stdlib/vacpp.hpp b/sprout/config/stdlib/vacpp.hpp new file mode 100644 index 00000000..65d309d8 --- /dev/null +++ b/sprout/config/stdlib/vacpp.hpp @@ -0,0 +1,28 @@ +#ifndef SPROUT_CONFIG_STDLIB_VACPP_HPP +#define SPROUT_CONFIG_STDLIB_VACPP_HPP + +#define SPROUT_NO_CXX11_HDR_ARRAY +#define SPROUT_NO_CXX11_HDR_CHRONO +#define SPROUT_NO_CXX11_HDR_CODECVT +#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE +#define SPROUT_NO_CXX11_HDR_FORWARD_LIST +#define SPROUT_NO_CXX11_HDR_FUTURE +#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST +#define SPROUT_NO_CXX11_HDR_MUTEX +#define SPROUT_NO_CXX11_HDR_RANDOM +#define SPROUT_NO_CXX11_HDR_RATIO +#define SPROUT_NO_CXX11_HDR_REGEX +#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR +#define SPROUT_NO_CXX11_HDR_THREAD +#define SPROUT_NO_CXX11_HDR_TUPLE +#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS +#define SPROUT_NO_CXX11_HDR_TYPEINDEX +#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP +#define SPROUT_NO_CXX11_HDR_UNORDERED_SET +#define SPROUT_NO_CXX11_NUMERIC_LIMITS +#define SPROUT_NO_CXX11_ALLOCATOR +#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR +#define SPROUT_NO_CXX11_SMART_PTR +#define SPROUT_NO_CXX11_HDR_FUNCTIONAL + +#endif // #ifndef SPROUT_CONFIG_STDLIB_VACPP_HPP diff --git a/sprout/string/char_traits.hpp b/sprout/string/char_traits.hpp index 757ff6e4..d9587a9f 100644 --- a/sprout/string/char_traits.hpp +++ b/sprout/string/char_traits.hpp @@ -2,6 +2,7 @@ #define SPROUT_STRING_CHAR_TRAITS_HPP #include +#include #include #include #include @@ -66,12 +67,21 @@ namespace sprout { static void assign(char_type& c1, char_type const& c2) SPROUT_NOEXCEPT { impl_type::assign(c1, c2); } +#ifdef SPROUT_NO_CXX11_CHAR_TRAITS + static SPROUT_CONSTEXPR bool eq(char_type c1, char_type c2) SPROUT_NOEXCEPT { + return c1 == c2; + } + static SPROUT_CONSTEXPR bool lt(char_type c1, char_type c2) SPROUT_NOEXCEPT { + return c1 < c2; + } +#else static SPROUT_CONSTEXPR bool eq(char_type c1, char_type c2) SPROUT_NOEXCEPT { return impl_type::eq(c1, c2); } static SPROUT_CONSTEXPR bool lt(char_type c1, char_type c2) SPROUT_NOEXCEPT { return impl_type::lt(c1, c2); } +#endif static SPROUT_CONSTEXPR int compare(char_type const* s1, char_type const* s2, std::size_t n) { return sprout::tristate_lexicographical_compare( sprout::ptr_index(s1), sprout::ptr_index(s1, n), char_type(), @@ -102,6 +112,25 @@ namespace sprout { static char_type* assign(char_type* s, std::size_t n, char_type a) { return impl_type::assign(s, n, a); } +#ifdef SPROUT_NO_CXX11_CHAR_TRAITS + static SPROUT_CONSTEXPR int_type not_eof(int_type c) SPROUT_NOEXCEPT { + return eq_int_type(c, eof()) ? int_type() + : c + ; + } + static SPROUT_CONSTEXPR char_type to_char_type(int_type c) SPROUT_NOEXCEPT { + return static_cast(c); + } + static SPROUT_CONSTEXPR int_type to_int_type(char_type c) SPROUT_NOEXCEPT { + return static_cast(c); + } + static SPROUT_CONSTEXPR bool eq_int_type(int_type c1, int_type c2) SPROUT_NOEXCEPT { + return c1 == c2; + } + static SPROUT_CONSTEXPR int_type eof() SPROUT_NOEXCEPT { + return static_cast(EOF); + } +#else static SPROUT_CONSTEXPR int_type not_eof(int_type c) SPROUT_NOEXCEPT { return impl_type::not_eof(c); } @@ -117,6 +146,7 @@ namespace sprout { static SPROUT_CONSTEXPR int_type eof() SPROUT_NOEXCEPT { return impl_type::eof(); } +#endif #if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION template static SPROUT_CONSTEXPR int compare(char_type const* s1, ConstIterator s2, std::size_t n) { diff --git a/testspr/typeinfo.hpp b/testspr/typeinfo.hpp index 53dc29d1..922f87d1 100644 --- a/testspr/typeinfo.hpp +++ b/testspr/typeinfo.hpp @@ -34,7 +34,7 @@ namespace testspr { // #ifdef TESTSPR_HAS_CXXABI_H namespace detail { - std::string gcc_demangle(char const* mangled) { + std::string cxa_demangle(char const* mangled) { int status; char* demangled = abi::__cxa_demangle(mangled, 0, 0, &status); std::string result(demangled); @@ -44,7 +44,7 @@ namespace testspr { } // namespace detail template inline std::string typename_of() { - return testspr::detail::gcc_demangle(typeid(T).name()); + return testspr::detail::cxa_demangle(typeid(T).name()); } #else template