Problem: no CI with VS2019 or any VS with C++11/14/17 mode, build broken in C++17 mode

Solution: add CI configuration and fix active_poller.cpp
This commit is contained in:
Simon Giesecke 2020-01-29 21:31:20 +01:00
parent 4bd01bc0ef
commit 84d4f959db
4 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,7 @@
version: build-{build}
os:
- Visual Studio 2019
- Visual Studio 2017
- Visual Studio 2015

View File

@ -29,8 +29,12 @@ add_executable(
send_multipart.cpp
monitor.cpp
utilities.cpp
../zmq.hpp
../zmq_addon.hpp
)
set_property(TARGET unit_tests PROPERTY CXX_STANDARD 17)
add_dependencies(unit_tests catch)
target_include_directories(unit_tests PUBLIC ${CATCH_MODULE_PATH})

View File

@ -158,6 +158,8 @@ namespace
{
struct server_client_setup : common_server_client_setup
{
using common_server_client_setup::common_server_client_setup;
zmq::active_poller_t::handler_type handler = [&](zmq::event_flags e)
{
events = e;

10
zmq.hpp
View File

@ -33,13 +33,15 @@
#endif
#if (defined(__cplusplus) && __cplusplus >= 201402L) \
|| (defined(_HAS_CXX14) && _HAS_CXX14 == 1) \
|| (defined(_HAS_CXX17) \
&& _HAS_CXX17 \
== 1) // _HAS_CXX14 might not be defined when using C++17 on MSVC
|| (defined(_HAS_CXX17) && _HAS_CXX17 == 1) \
|| (defined(_MSVC_LANG) \
&& _MSVC_LANG \
>= 201402L) // _HAS_CXX14 might not be defined when using C++17 on MSVC
#define ZMQ_CPP14
#endif
#if (defined(__cplusplus) && __cplusplus >= 201703L) \
|| (defined(_HAS_CXX17) && _HAS_CXX17 == 1)
|| (defined(_HAS_CXX17) && _HAS_CXX17 == 1) \
|| (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
#define ZMQ_CPP17
#endif