Fix some string_view problems

This commit is contained in:
Michael 2019-07-16 23:55:58 +01:00
parent 71c6aca820
commit ac8624698d
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C
3 changed files with 10 additions and 8 deletions

View File

@ -59,6 +59,7 @@ else()
endif(MSVC_VERSION) endif(MSVC_VERSION)
add_compile_options(/EHca /arch:AVX2) add_compile_options(/EHca /arch:AVX2)
add_definitions(/D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING)
include(cmake/solaris.cmake) include(cmake/solaris.cmake)

View File

@ -114,26 +114,26 @@ namespace llarp
if(ret) if(ret)
{ {
LogError("failed to determine address family: ", str); LogError("failed to determine address family: ", in);
return false; return false;
} }
if(res->ai_family == AF_INET6) if(res->ai_family == AF_INET6)
{ {
LogError("IPv6 address not supported yet", str); LogError("IPv6 address not supported yet", in);
return false; return false;
} }
if(res->ai_family != AF_INET) if(res->ai_family != AF_INET)
{ {
LogError("Address family not supported yet", str); LogError("Address family not supported yet", in);
return false; return false;
} }
// put it in _addr4 // put it in _addr4
struct in_addr* addr = &_addr4.sin_addr; struct in_addr* addr = &_addr4.sin_addr;
if(inet_aton(str, addr) == 0) if(inet_aton(std::string(in).c_str(), addr) == 0)
{ {
LogError("failed to parse ", str); LogError("failed to parse ", in);
return false; return false;
} }

View File

@ -1,12 +1,13 @@
#ifndef LLARP_UTIL_LOGGER_INTERNAL_HPP #ifndef LLARP_UTIL_LOGGER_INTERNAL_HPP
#define LLARP_UTIL_LOGGER_INTERNAL_HPP #define LLARP_UTIL_LOGGER_INTERNAL_HPP
#include <util/time.hpp>
#include <absl/time/clock.h> #include <absl/time/clock.h>
#include <absl/time/time.h> #include <absl/time/time.h>
#include <util/time.hpp>
#include <sstream>
#include <ctime> #include <ctime>
#include <iomanip> #include <iomanip>
#include <sstream>
#include <thread> #include <thread>
namespace llarp namespace llarp
@ -27,7 +28,7 @@ namespace llarp
LogAppend(ss, std::forward< TArgs >(args)...); LogAppend(ss, std::forward< TArgs >(args)...);
} }
static inline std::string inline std::string
thread_id_string() thread_id_string()
{ {
auto tid = std::this_thread::get_id(); auto tid = std::this_thread::get_id();