diff options
author | eidheim <eidheim@gmail.com> | 2020-04-03 12:13:22 +0300 |
---|---|---|
committer | eidheim <eidheim@gmail.com> | 2020-04-03 12:13:22 +0300 |
commit | 4c8c21cb5943b7272e88ffef1649a1dd72b89852 (patch) | |
tree | ec575daf1a57ea36eca7d5e075148dcca20e0dcb | |
parent | 64ac62617e809d553a902b0a7c8e3e8e308a8284 (diff) |
Added workarounds for various Windows/MSVC issues
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | client_ws.hpp | 2 | ||||
-rw-r--r-- | 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<std::size_t>::max(); + std::size_t max_message_size = (std::numeric_limits<std::size_t>::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<std::size_t>::max(); + std::size_t max_message_size = (std::numeric_limits<std::size_t>::max)(); /// Additional header fields to send when performing WebSocket handshake. CaseInsensitiveMultimap header; /// IPv4 address in dotted decimal form or IPv6 address in hexadecimal notation. |