From 04c618ddaeb5dab6d73ff23fd6169e4fc6e9b84b Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Tue, 25 Feb 2020 13:33:39 -0400 Subject: [PATCH] gcc 5 compatibility workaround --- llarp/config/config.cpp | 11 ++++++----- llarp/config/ini.cpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/llarp/config/config.cpp b/llarp/config/config.cpp index 392b8b58d..32aa359a4 100644 --- a/llarp/config/config.cpp +++ b/llarp/config/config.cpp @@ -238,7 +238,7 @@ namespace llarp } else { - m_netConfig.emplace(key, val); + m_netConfig.emplace(str(key), str(val)); // str()'s here for gcc 5 compat } } @@ -257,12 +257,12 @@ namespace llarp if(key == "upstream") { llarp::LogInfo("add upstream resolver ", val); - netConfig.emplace("upstream-dns", val); + netConfig.emplace("upstream-dns", str(val)); // str() for gcc 5 compat } if(key == "bind") { llarp::LogInfo("set local dns to ", val); - netConfig.emplace("local-dns", val); + netConfig.emplace("local-dns", str(val)); // str() for gcc 5 compat } } @@ -314,7 +314,8 @@ namespace llarp } else { - m_InboundLinks.emplace_back(key, AF_INET, proto, std::move(opts)); + // str() here for gcc 5 compat + m_InboundLinks.emplace_back(str(key), AF_INET, proto, std::move(opts)); } } @@ -327,7 +328,7 @@ namespace llarp void ServicesConfig::fromSection(string_view key, string_view val) { - services.emplace_back(key, val); + services.emplace_back(str(key), str(val)); // str()'s here for gcc 5 compat } void diff --git a/llarp/config/ini.cpp b/llarp/config/ini.cpp index 8d68ac654..90401b703 100644 --- a/llarp/config/ini.cpp +++ b/llarp/config/ini.cpp @@ -131,7 +131,7 @@ namespace llarp } Section_t& sect = m_Config[str(sectName)]; LogDebug(m_FileName, ": ", sectName, ".", k, "=", v); - sect.emplace(k, v); + sect.emplace(str(k), str(v)); // str()'s here for gcc 5 compat } else // malformed? {