1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

fix auto_ptr workaround

This commit is contained in:
bolero-MURAKAMI 2017-09-20 17:11:33 +09:00
parent 9cc597fcbe
commit aefc564640
3 changed files with 150 additions and 7 deletions

View file

@ -45,6 +45,79 @@
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 610 #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 610
# define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST # define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
# define SPROUT_NO_CXX11_HDR_ATOMIC # define SPROUT_NO_CXX11_HDR_ATOMIC
# define SPROUT_NO_CXX11_ALLOCATOR
# define SPROUT_NO_CXX11_STD_ALIGN
#endif
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
# define SPROUT_NO_CXX11_POINTER_TRAITS
#elif defined(_MSC_VER) && _MSC_VER < 1910
# define SPROUT_NO_CXX11_POINTER_TRAITS
#endif
#if defined(__has_include)
#if !__has_include(<shared_mutex>)
# define SPROUT_NO_CXX14_HDR_SHARED_MUTEX
#elif (__cplusplus < 201402) && !defined(_MSC_VER)
# define SPROUT_NO_CXX14_HDR_SHARED_MUTEX
#endif
#elif !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
# define SPROUT_NO_CXX14_HDR_SHARED_MUTEX
#endif
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
# define SPROUT_NO_CXX14_STD_EXCHANGE
#endif
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(_MSC_VER) || (_MSC_VER < 1910) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)
# define SPROUT_NO_CXX17_STD_APPLY
#endif
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
# define SPROUT_NO_CXX17_STD_INVOKE
#endif
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
# define SPROUT_NO_CXX11_ADDRESSOF
#endif
#if defined(_CPPLIB_VER) && (_CPPLIB_VER == 650)
# define SPROUT_NO_CXX11_HDR_CODECVT
#endif
#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 650)
# if defined(_HAS_AUTO_PTR_ETC) && (_HAS_AUTO_PTR_ETC == 0)
# define SPROUT_NO_AUTO_PTR
# define SPROUT_NO_CXX98_RANDOM_SHUFFLE
# define SPROUT_NO_CXX98_FUNCTION_BASE
# define SPROUT_NO_CXX98_BINDERS
# endif
#endif
#ifdef _M_CEE
# ifndef SPROUT_NO_CXX11_HDR_MUTEX
# define SPROUT_NO_CXX11_HDR_MUTEX
# endif
# ifndef SPROUT_NO_CXX11_HDR_ATOMIC
# define SPROUT_NO_CXX11_HDR_ATOMIC
# endif
# ifndef SPROUT_NO_CXX11_HDR_FUTURE
# define SPROUT_NO_CXX11_HDR_FUTURE
# endif
# ifndef SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
# endif
# ifndef SPROUT_NO_CXX11_HDR_THREAD
# define SPROUT_NO_CXX11_HDR_THREAD
# endif
# ifndef SPROUT_NO_CXX14_HDR_SHARED_MUTEX
# define SPROUT_NO_CXX14_HDR_SHARED_MUTEX
# endif
# ifndef SPROUT_NO_CXX14_STD_EXCHANGE
# define SPROUT_NO_CXX14_STD_EXCHANGE
# endif
# ifndef SPROUT_NO_FENV_H
# define SPROUT_NO_FENV_H
# endif
#endif #endif
#define SPROUT_NO_CXX14_INITIALIZER_LIST #define SPROUT_NO_CXX14_INITIALIZER_LIST

View file

@ -12,11 +12,82 @@
# define SPROUT_NO_CXX11_HDR_TUPLE # define SPROUT_NO_CXX11_HDR_TUPLE
#endif #endif
#define SPROUT_NO_CXX11_HDR_CHRONO #if defined(_LIBCPP_HAS_NO_TEMPLATE_ALIASES)
#define SPROUT_NO_CXX11_HDR_FUTURE # define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS # define SPROUT_NO_CXX11_POINTER_TRAITS
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR #endif
#define SPROUT_NO_CXX11_HDR_ATOMIC
#if __cplusplus < 201103
# define SPROUT_NO_CXX11_HDR_CODECVT
# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
# 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_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_POINTER_TRAITS
# define SPROUT_NO_CXX11_SMART_PTR
# define SPROUT_NO_CXX11_HDR_FUNCTIONAL
# define SPROUT_NO_CXX11_STD_ALIGN
# define SPROUT_NO_CXX11_ADDRESSOF
# define SPROUT_NO_CXX11_HDR_ATOMIC
# define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
# define SPROUT_NO_CXX11_HDR_CHRONO
# define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
# define SPROUT_NO_CXX11_HDR_FUTURE
#elif _LIBCPP_VERSION < 3700
# define SPROUT_NO_CXX11_HDR_ATOMIC
# define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
# define SPROUT_NO_CXX11_HDR_CHRONO
# define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
# define SPROUT_NO_CXX11_HDR_FUTURE
#endif
#if _LIBCPP_VERSION < 3700
# define SPROUT_NO_STD_MESSAGES
#endif
#if (_LIBCPP_VERSION < 3700) || (__cplusplus <= 201402L)
# define SPROUT_NO_CXX14_STD_EXCHANGE
#endif
#if (_LIBCPP_VERSION < 3700) || (__cplusplus <= 201402L)
# define SPROUT_NO_CXX17_STD_INVOKE
#endif
#if (_LIBCPP_VERSION < 4000) || (__cplusplus <= 201402L)
# define SPROUT_NO_CXX17_STD_APPLY
#endif
#if (_LIBCPP_VERSION > 4000) && (__cplusplus > 201402L) && !defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
# define SPROUT_NO_AUTO_PTR
#endif
#if (_LIBCPP_VERSION > 4000) && (__cplusplus > 201402L) && !defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE)
# define SPROUT_NO_CXX98_RANDOM_SHUFFLE
#endif
#if (_LIBCPP_VERSION > 4000) && (__cplusplus > 201402L) && !defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
# define SPROUT_NO_CXX98_BINDERS
#endif
#if (_LIBCPP_VERSION <= 1101) && !defined(SPROUT_NO_CXX11_THREAD_LOCAL)
# define SPROUT_NO_CXX11_THREAD_LOCAL
#endif
#if defined(__has_include)
#if !__has_include(<shared_mutex>)
# define SPROUT_NO_CXX14_HDR_SHARED_MUTEX
#elif __cplusplus <= 201103
# define SPROUT_NO_CXX14_HDR_SHARED_MUTEX
#endif
#elif __cplusplus < 201402
# define SPROUT_NO_CXX14_HDR_SHARED_MUTEX
#endif
#include <utility> #include <utility>
#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION <= 1001) #if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION <= 1001)

View file

@ -10,7 +10,6 @@
#include <memory> #include <memory>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/detail/predef.hpp>
namespace sprout { namespace sprout {
// //
@ -22,7 +21,7 @@ namespace sprout {
return p; return p;
} }
#if !SPROUT_CLANG_OR_LATER(5, 0, 0) || (_LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)) #if !defined(SPROUT_NO_AUTO_PTR)
template<typename T> template<typename T>
inline SPROUT_NON_CONSTEXPR T* inline SPROUT_NON_CONSTEXPR T*
get_pointer(std::auto_ptr<T> const& p) SPROUT_NOEXCEPT { get_pointer(std::auto_ptr<T> const& p) SPROUT_NOEXCEPT {