From 4c8c21cb5943b7272e88ffef1649a1dd72b89852 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 3 Apr 2020 11:13:22 +0200 Subject: Added workarounds for various Windows/MSVC issues --- CMakeLists.txt | 4 ++-- client_ws.hpp | 2 +- server_ws.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4762393..5a9429d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ else() find_package(Boost 1.54.0 COMPONENTS system thread coroutine context REQUIRED) target_link_libraries(simple-websocket-server INTERFACE ${Boost_LIBRARIES}) target_include_directories(simple-websocket-server INTERFACE ${Boost_INCLUDE_DIR}) - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) target_compile_definitions(simple-websocket-server INTERFACE USE_BOOST_REGEX) find_package(Boost 1.54.0 COMPONENTS regex REQUIRED) target_link_libraries(simple-websocket-server INTERFACE ${Boost_LIBRARIES}) @@ -54,7 +54,7 @@ target_link_libraries(simple-websocket-server INTERFACE ${OPENSSL_LIBRARIES}) target_include_directories(simple-websocket-server INTERFACE ${OPENSSL_INCLUDE_DIR}) # If Simple-WebSocket-Server is not a sub-project: -if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") +if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") add_executable(ws_examples ws_examples.cpp) target_link_libraries(ws_examples simple-websocket-server) add_executable(wss_examples wss_examples.cpp) diff --git a/client_ws.hpp b/client_ws.hpp index 3c9679e..a892149 100644 --- a/client_ws.hpp +++ b/client_ws.hpp @@ -267,7 +267,7 @@ namespace SimpleWeb { long timeout_idle = 0; /// Maximum size of incoming messages. Defaults to architecture maximum. /// Exceeding this limit will result in a message_size error code and the connection will be closed. - std::size_t max_message_size = std::numeric_limits::max(); + std::size_t max_message_size = (std::numeric_limits::max)(); /// Additional header fields to send when performing WebSocket upgrade. /// Use this variable to for instance set Sec-WebSocket-Protocol. CaseInsensitiveMultimap header; diff --git a/server_ws.hpp b/server_ws.hpp index 96205dc..e91a479 100644 --- a/server_ws.hpp +++ b/server_ws.hpp @@ -325,7 +325,7 @@ namespace SimpleWeb { long timeout_idle = 0; /// Maximum size of incoming messages. Defaults to architecture maximum. /// Exceeding this limit will result in a message_size error code and the connection will be closed. - std::size_t max_message_size = std::numeric_limits::max(); + std::size_t max_message_size = (std::numeric_limits::max)(); /// Additional header fields to send when performing WebSocket handshake. CaseInsensitiveMultimap header; /// IPv4 address in dotted decimal form or IPv6 address in hexadecimal notation. -- cgit v1.2.3