From 15ab3e48edf9ecdf836c551ea5e0e83d15b5f940 Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Sat, 5 Sep 2020 18:47:15 -0400 Subject: [PATCH] Fix builds with older gcc versions (at least 5.4.0) --- CMakeLists.txt | 4 ++++ src/rest_server.cpp | 2 +- src/rpc/json.h | 2 +- src/rpc/light_wallet.h | 14 +++++++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 463b26f..05db9c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,10 @@ cmake_minimum_required(VERSION 3.1.0) project(monero-lws) +enable_language(CXX) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(MONERO_LIBRARIES daemon_messages serialization diff --git a/src/rest_server.cpp b/src/rest_server.cpp index 589af29..256a193 100644 --- a/src/rest_server.cpp +++ b/src/rest_server.cpp @@ -141,7 +141,7 @@ namespace lws if (!user) return user.error(); - response resp{.rates = {common_error::kInvalidArgument}}; + response resp{}; auto outputs = user->second.get_outputs(user->first.id); if (!outputs) diff --git a/src/rpc/json.h b/src/rpc/json.h index 11c1480..3c773ac 100644 --- a/src/rpc/json.h +++ b/src/rpc/json.h @@ -43,7 +43,7 @@ namespace rpc unsigned id; const char* method; //!< Must be in static memory }; - const char json_request_base::jsonrpc[]; + constexpr const char json_request_base::jsonrpc[]; //! \tparam W implements the WRITE concept \tparam M implements the METHOD concept template diff --git a/src/rpc/light_wallet.h b/src/rpc/light_wallet.h index cc9cb81..21468b0 100644 --- a/src/rpc/light_wallet.h +++ b/src/rpc/light_wallet.h @@ -76,7 +76,19 @@ namespace rpc struct get_address_info_response { - get_address_info_response() = delete; + get_address_info_response() noexcept + : locked_funds(safe_uint64(0)), + total_received(safe_uint64(0)), + total_sent(safe_uint64(0)), + scanned_height(0), + scanned_block_height(0), + start_height(0), + transaction_height(0), + blockchain_height(0), + spent_outputs(), + rates(common_error::kInvalidArgument) + {} + safe_uint64 locked_funds; safe_uint64 total_received; safe_uint64 total_sent;