From 6a557bfc91bd7a1de927b8e24dfaf4992ed506d2 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 26 Mar 2021 10:27:00 +0100 Subject: Make use of ASIO_STANDALONE when using standalone asio in order to compile on older asio versions without boost --- CMakeLists.txt | 2 +- asio_compatibility.hpp | 4 ++-- client_wss.hpp | 2 +- server_wss.hpp | 2 +- utility.hpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11e11f1..5c83068 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ target_link_libraries(simple-websocket-server INTERFACE ${CMAKE_THREAD_LIBS_INIT # TODO 2020 when Debian Jessie LTS ends: # Remove Boost system, thread, regex components; use Boost:: aliases; remove Boost target_include_directories if(USE_STANDALONE_ASIO) - target_compile_definitions(simple-websocket-server INTERFACE USE_STANDALONE_ASIO) + target_compile_definitions(simple-websocket-server INTERFACE ASIO_STANDALONE) find_path(ASIO_PATH asio.hpp) if(NOT ASIO_PATH) message(FATAL_ERROR "Standalone Asio not found") diff --git a/asio_compatibility.hpp b/asio_compatibility.hpp index c2e0b66..5a7007d 100644 --- a/asio_compatibility.hpp +++ b/asio_compatibility.hpp @@ -3,7 +3,7 @@ #include -#ifdef USE_STANDALONE_ASIO +#ifdef ASIO_STANDALONE #include #include namespace SimpleWeb { @@ -27,7 +27,7 @@ namespace SimpleWeb { #endif namespace SimpleWeb { -#if(USE_STANDALONE_ASIO && ASIO_VERSION >= 101300) || BOOST_ASIO_VERSION >= 101300 +#if(ASIO_STANDALONE && ASIO_VERSION >= 101300) || BOOST_ASIO_VERSION >= 101300 using io_context = asio::io_context; using resolver_results = asio::ip::tcp::resolver::results_type; using async_connect_endpoint = asio::ip::tcp::endpoint; diff --git a/client_wss.hpp b/client_wss.hpp index 9c5d1e0..6086c7f 100644 --- a/client_wss.hpp +++ b/client_wss.hpp @@ -3,7 +3,7 @@ #include "client_ws.hpp" -#ifdef USE_STANDALONE_ASIO +#ifdef ASIO_STANDALONE #include #else #include diff --git a/server_wss.hpp b/server_wss.hpp index db1aed6..7e21ef3 100644 --- a/server_wss.hpp +++ b/server_wss.hpp @@ -5,7 +5,7 @@ #include #include -#ifdef USE_STANDALONE_ASIO +#ifdef ASIO_STANDALONE #include #else #include diff --git a/utility.hpp b/utility.hpp index 3b41ff3..d9119de 100644 --- a/utility.hpp +++ b/utility.hpp @@ -27,7 +27,7 @@ namespace SimpleWeb { using string_view = std::string_view; } -#elif !defined(USE_STANDALONE_ASIO) +#elif !defined(ASIO_STANDALONE) #include namespace SimpleWeb { using string_view = boost::string_ref; -- cgit v1.2.3