mirror of https://github.com/oxen-io/lokinet
win32 g++ is set to c++17 by default, so we use the _real_ string_view class
This commit is contained in:
parent
b53420d538
commit
f277f368a1
|
@ -104,6 +104,8 @@ else()
|
|||
endif(DEBIAN)
|
||||
|
||||
# only needed if using AVX2
|
||||
# TODO: generate a config-time test for this
|
||||
# in cmake
|
||||
if(AMD_RYZEN_HACK AND USE_AVX2)
|
||||
set(CRYPTO_FLAGS -march=native -mfpmath=sse -mavx -mavx2 -mfma)
|
||||
endif(AMD_RYZEN_HACK AND USE_AVX2)
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <wordexp.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
@ -62,6 +65,7 @@ handle_signal_win32(DWORD fdwCtrlType)
|
|||
std::string
|
||||
resolvePath(std::string conffname)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
wordexp_t exp_result;
|
||||
wordexp(conffname.c_str(), &exp_result, 0);
|
||||
char *resolvedPath = realpath(exp_result.we_wordv[0], NULL);
|
||||
|
@ -71,6 +75,11 @@ resolvePath(std::string conffname)
|
|||
return "";
|
||||
}
|
||||
return resolvedPath;
|
||||
#else
|
||||
// TODO(despair): dig through LLVM local patch set
|
||||
// one of these exists deep in the bowels of LLVMSupport
|
||||
return conffname; // eww, easier said than done outside of cygwin
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -110,11 +119,6 @@ main(int argc, char *argv[])
|
|||
genconfigOnly = true;
|
||||
break;
|
||||
case 'r':
|
||||
#ifdef _WIN32
|
||||
llarp::LogWarn(
|
||||
"please don't try this at home, the relay feature is untested on "
|
||||
"windows server --R.");
|
||||
#endif
|
||||
asRouter = true;
|
||||
break;
|
||||
case 'f':
|
||||
|
@ -227,7 +231,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
// this is important, can downgrade from Info though
|
||||
llarp::LogInfo("Running from: ", cpp17::filesystem::current_path());
|
||||
llarp::LogInfo("Running from: ", fs::current_path());
|
||||
llarp::LogInfo("Using config file: ", conffname);
|
||||
ctx = llarp_main_init(conffname.c_str(), multiThreaded);
|
||||
int code = 1;
|
||||
|
|
|
@ -256,8 +256,13 @@ TEST_F(TestCryptoTypesSecret, secret_key_to_missing_file)
|
|||
// Verify writing to an unwritable file fails.
|
||||
// Assume we're not running as root, so can't write to /
|
||||
// if we are root just skip this test
|
||||
// TODO(despair): check elevation status, return if running
|
||||
// as someone who can write to C:/
|
||||
// (normal users cannot write to C:/)
|
||||
#ifndef _WIN32
|
||||
if(getuid() == 0)
|
||||
return;
|
||||
#endif
|
||||
filename = "/" + filename;
|
||||
p = filename;
|
||||
ASSERT_FALSE(fs::exists(fs::status(p)));
|
||||
|
|
|
@ -31,7 +31,11 @@ TEST_F(TestINIParser, TestParseOneSection)
|
|||
ASSERT_EQ(itr, sect.end());
|
||||
itr = sect.find("key");
|
||||
ASSERT_NE(itr, sect.end());
|
||||
#if __cplusplus >= 201703L
|
||||
ASSERT_STREQ(itr->second.data(), "val");
|
||||
#else
|
||||
ASSERT_STREQ(itr->second.c_str(), "val");
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_F(TestINIParser, TestParseSectionDuplicateKeys)
|
||||
|
@ -49,4 +53,4 @@ TEST_F(TestINIParser, TestParseSectionDuplicateKeys)
|
|||
TEST_F(TestINIParser, TestParseInvalid)
|
||||
{
|
||||
ASSERT_FALSE(parser.LoadString("srged5ghe5\nf34wtge5\nw34tgfs4ygsd5yg=4;\n#g4syhgd5\n"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue