From 391f81bcf9b68084e632cf76a4237fb9fc85a5cd Mon Sep 17 00:00:00 2001 From: yang li Date: Thu, 11 Jul 2019 16:14:13 +0800 Subject: [PATCH] Fix the detection of std::future availability with libstdc++. --- include/ascs/config.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/ascs/config.h b/include/ascs/config.h index 32bb608..fafdcf1 100644 --- a/include/ascs/config.h +++ b/include/ascs/config.h @@ -880,11 +880,14 @@ static_assert(ASCS_MSG_HANDLING_INTERVAL >= 0, "the interval of msg handling mus //if you don't define this macro, the next callback will be called at (xx:xx:xx + 21), please note. //#define ASCS_SYNC_SEND -#ifdef ASCS_SYNC_SEND - #ifndef ASIO_HAS_STD_FUTURE - #define ASIO_HAS_STD_FUTURE 0 +//before 1.12.2, asio has a problem or no ability with the detection of std::future availability with libstdc++. +#if ASIO_VERSION >= 101202 + #ifdef ASCS_SYNC_SEND + #ifndef ASIO_HAS_STD_FUTURE + #define ASIO_HAS_STD_FUTURE 0 + #endif + static_assert(ASIO_HAS_STD_FUTURE == 1, "sync message sending needs std::future."); #endif - static_assert(ASIO_HAS_STD_FUTURE == 1, "sync message sending needs std::future."); #endif //#define ASCS_SYNC_RECV //define these macro to gain additional series of sync message sending and receiving, they are: -- GitLab