summaryrefslogtreecommitdiff
path: root/boost/asio/detail/config.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/detail/config.hpp')
-rw-r--r--boost/asio/detail/config.hpp91
1 files changed, 78 insertions, 13 deletions
diff --git a/boost/asio/detail/config.hpp b/boost/asio/detail/config.hpp
index b3272a666f..126be7e64f 100644
--- a/boost/asio/detail/config.hpp
+++ b/boost/asio/detail/config.hpp
@@ -2,7 +2,7 @@
// detail/config.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -69,6 +69,9 @@
|| (!defined(__MWERKS__) && !defined(__EDG_VERSION__)))
# define BOOST_ASIO_MSVC _MSC_VER
# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
+#endif // !defined(BOOST_ASIO_MSVC)
+#if defined(BOOST_ASIO_MSVC)
+# include <ciso646> // Needed for _HAS_CXX17.
#endif // defined(BOOST_ASIO_MSVC)
// Clang / libc++ detection.
@@ -756,7 +759,9 @@
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_FUTURE 1
+# if defined(_GLIBCXX_HAS_GTHREADS)
+# define BOOST_ASIO_HAS_STD_FUTURE 1
+# endif // defined(_GLIBCXX_HAS_GTHREADS)
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
@@ -768,13 +773,37 @@
# endif // !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
#endif // !defined(BOOST_ASIO_HAS_STD_FUTURE)
-// Standard library support for experimental::string_view.
+// Standard library support for std::string_view.
#if !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
# if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
# if defined(__clang__)
+# if (__cplusplus >= 201703)
+# if __has_include(<string_view>)
+# define BOOST_ASIO_HAS_STD_STRING_VIEW 1
+# endif // __has_include(<string_view>)
+# endif // (__cplusplus >= 201703)
+# endif // defined(__clang__)
+# if defined(__GNUC__)
+# if (__GNUC__ >= 7)
+# if (__cplusplus >= 201703)
+# define BOOST_ASIO_HAS_STD_STRING_VIEW 1
+# endif // (__cplusplus >= 201703)
+# endif // (__GNUC__ >= 7)
+# endif // defined(__GNUC__)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_VER >= 1910 && _HAS_CXX17)
+# define BOOST_ASIO_HAS_STD_STRING_VIEW
+# endif // (_MSC_VER >= 1910 && _HAS_CXX17)
+# endif // defined(BOOST_ASIO_MSVC)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
+#endif // !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
+
+// Standard library support for std::experimental::string_view.
+#if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+# if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
+# if defined(__clang__)
# if (__cplusplus >= 201402)
# if __has_include(<experimental/string_view>)
-# define BOOST_ASIO_HAS_STD_STRING_VIEW 1
# define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
# endif // __has_include(<experimental/string_view>)
# endif // (__cplusplus >= 201402)
@@ -782,18 +811,23 @@
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
# if (__cplusplus >= 201402)
-# define BOOST_ASIO_HAS_STD_STRING_VIEW 1
# define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
# endif // (__cplusplus >= 201402)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
-# if defined(BOOST_ASIO_MSVC)
-# if (_MSC_VER >= 1910 && _HAS_CXX17)
-# define BOOST_ASIO_HAS_STD_STRING_VIEW
-# endif // (_MSC_VER >= 1910)
-# endif // defined(BOOST_ASIO_MSVC)
-# endif // !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
-#endif // !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
+#endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+
+// Standard library has a string_view that we can use.
+#if !defined(BOOST_ASIO_HAS_STRING_VIEW)
+# if !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
+# if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
+# define BOOST_ASIO_HAS_STRING_VIEW 1
+# elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+# define BOOST_ASIO_HAS_STRING_VIEW 1
+# endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+# endif // !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
+#endif // !defined(BOOST_ASIO_HAS_STRING_VIEW)
// Standard library support for iostream move construction and assignment.
#if !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
@@ -813,6 +847,17 @@
# endif // !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
#endif // !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
+// Standard library has invoke_result (which supersedes result_of).
+#if !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
+# if !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_VER >= 1910 && _HAS_CXX17)
+# define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
+# endif // (_MSC_VER >= 1910 && _HAS_CXX17)
+# endif // defined(BOOST_ASIO_MSVC)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
+#endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
+
// Windows App target. Windows but with a limited API.
#if !defined(BOOST_ASIO_WINDOWS_APP)
# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
@@ -1367,4 +1412,24 @@
# define BOOST_ASIO_UNUSED_VARIABLE
#endif // !defined(BOOST_ASIO_UNUSED_VARIABLE)
+// Support co_await on compilers known to allow it.
+#if !defined(BOOST_ASIO_HAS_CO_AWAIT)
+# if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_FULL_VER >= 190023506)
+# if defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
+# define BOOST_ASIO_HAS_CO_AWAIT 1
+# endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
+# endif // (_MSC_FULL_VER >= 190023506)
+# endif // defined(BOOST_ASIO_MSVC)
+# endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
+# if defined(__clang__)
+# if (__cpp_coroutines >= 201703)
+# if __has_include(<experimental/coroutine>)
+# define BOOST_ASIO_HAS_CO_AWAIT 1
+# endif // __has_include(<experimental/coroutine>)
+# endif // (__cpp_coroutines >= 201703)
+# endif // defined(__clang__)
+#endif // !defined(BOOST_ASIO_HAS_CO_AWAIT)
+
#endif // BOOST_ASIO_DETAIL_CONFIG_HPP