From bc940e3365faad180a536d602f7ae0110515ee68 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 3 Feb 2018 19:35:43 -0500 Subject: ... --- promise.hpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'promise.hpp') diff --git a/promise.hpp b/promise.hpp index 8fdf14e..1173e87 100644 --- a/promise.hpp +++ b/promise.hpp @@ -27,12 +27,18 @@ #include #include #include - -#if __has_include("any") -#include +#include + +#ifdef __has_include +# if __has_include() +# include +# ifdef __cpp_lib_any +# define _CPPROMISE_STD_ANY +# endif +# endif #endif -#if !defined(__cpp_lib_any) +#ifndef _CPPROMISE_STD_ANY #include #endif @@ -41,14 +47,14 @@ * Javascript Promise/A+. */ namespace promise { -#if defined(__cpp_lib_any) +#ifdef _CPPROMISE_STD_ANY using pm_any_t = std::any; template constexpr auto any_cast = static_cast(std::any_cast); using bad_any_cast = std::bad_any_cast; #else -#warning "using boost::any" -#pragma message "using boost::any" +# warning "using boost::any" +# pragma message "using boost::any" using pm_any_t = boost::any; template constexpr auto any_cast = static_cast(boost::any_cast); -- cgit v1.2.3