From 9021f43707c9968725f18441044dd0aec8400fe4 Mon Sep 17 00:00:00 2001 From: fireice-uk Date: Tue, 7 May 2019 18:30:56 +0100 Subject: [PATCH 1/5] boost 1.7.0 fixes --- CMakeLists.txt | 1 + contrib/epee/include/net/abstract_tcp_server2.inl | 6 +++--- contrib/epee/include/net/net_utils_base.h | 5 +++++ src/simplewallet/simplewallet.cpp | 1 + src/wallet/wallet_args.cpp | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82e49066..00300025 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -810,6 +810,7 @@ endif() include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) if(MINGW) + set(Boost_NO_BOOST_CMAKE ON) set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi) set(ICU_LIBRARIES ${Boost_LOCALE_LIBRARY} icuio icuin icuuc icudt icutu iconv) elseif(APPLE OR OPENBSD OR ANDROID) diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index b71607ec..3c12e172 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -204,7 +204,7 @@ bool connection::request_callback() template boost::asio::io_service &connection::get_io_service() { - return socket_.get_io_service(); + return GET_IO_SERVICE(socket_); } //--------------------------------------------------------------------------------- template @@ -367,7 +367,7 @@ bool connection::call_run_once_service_io() if(!m_is_multithreaded) { //single thread model, we can wait in blocked call - size_t cnt = socket_.get_io_service().run_one(); + size_t cnt = GET_IO_SERVICE(socket_).run_one(); if(!cnt) //service is going to quit return false; } @@ -378,7 +378,7 @@ bool connection::call_run_once_service_io() //if no handlers were called //TODO: Maybe we need to have have critical section + event + callback to upper protocol to //ask it inside(!) critical region if we still able to go in event wait... - size_t cnt = socket_.get_io_service().poll_one(); + size_t cnt = GET_IO_SERVICE(socket_).poll_one(); if(!cnt) misc_utils::sleep_no_w(0); } diff --git a/contrib/epee/include/net/net_utils_base.h b/contrib/epee/include/net/net_utils_base.h index 3c859ece..7a479173 100644 --- a/contrib/epee/include/net/net_utils_base.h +++ b/contrib/epee/include/net/net_utils_base.h @@ -363,4 +363,9 @@ inline MAKE_LOGGABLE(connection_context_base, ct, os) } } +#if BOOST_VERSION >= 107000 +#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context()) +#else +#define GET_IO_SERVICE(s) ((s).get_io_service()) +#endif #endif //_NET_UTILS_BASE_H_ diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index f38450e0..472e39df 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -83,6 +83,7 @@ #include #ifdef WIN32 +#undef fmt #include #include #include diff --git a/src/wallet/wallet_args.cpp b/src/wallet/wallet_args.cpp index 7ecc2488..05723ead 100644 --- a/src/wallet/wallet_args.cpp +++ b/src/wallet/wallet_args.cpp @@ -53,6 +53,7 @@ #include #if defined(WIN32) +#undef fmt #include #include #endif From 38be2db14ddf2fbe9a4707b9ef9a0b5fb68e974f Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 9 May 2019 22:03:33 +0200 Subject: [PATCH 2/5] fix boost 1.67 linking --- CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00300025..de3bc34d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,17 @@ cmake_minimum_required(VERSION 3.1.0) project(ryo) +# enforce C++11 +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 11) + +# enforce C11 +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS OFF) +set(CMAKE_C_STANDARD 11) + + function (die msg) if (NOT WIN32) string(ASCII 27 Esc) @@ -621,8 +632,8 @@ else() message(STATUS "AES support disabled") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS}") # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that From b45ca61fe524d6b4d1125bc3b7cbe5a354c786c7 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 9 May 2019 23:22:22 +0200 Subject: [PATCH 3/5] travis enforce ubuntu trusty --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 02924139..ee839f2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ cache: apt: true os: linux +dist: trusty addons: apt: From 336e9b7138aa15613bc2c4c2b72379c53a365772 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 9 May 2019 23:24:33 +0200 Subject: [PATCH 4/5] travis switch to xenial --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ee839f2d..76b66faa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ cache: apt: true os: linux -dist: trusty +dist: xenial addons: apt: From 996be7751c492b64918a7d7dd5ba1c17906b8563 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 9 May 2019 23:42:51 +0200 Subject: [PATCH 5/5] disable ABI --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de3bc34d..d217945f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -633,7 +633,7 @@ else() endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS}") # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that