From f734ffeae4a51ef226bfed707aca703214cdac70 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 15 May 2019 23:03:24 +0100 Subject: [PATCH] Fixup MSVC build --- CMakeSettings.json | 12 ++++++++++++ llarp/net/net_int.cpp | 2 ++ llarp/util/ini.cpp | 4 ++++ llarp/util/threadpool.cpp | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeSettings.json b/CMakeSettings.json index 33db87d0e..20e32e018 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -11,6 +11,18 @@ "buildCommandArgs": "-v", "ctestCommandArgs": "", "variables": [] + }, + { + "name": "x64-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}", + "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64_x64" ], + "variables": [] } ] } \ No newline at end of file diff --git a/llarp/net/net_int.cpp b/llarp/net/net_int.cpp index 0e3540710..478213f71 100644 --- a/llarp/net/net_int.cpp +++ b/llarp/net/net_int.cpp @@ -1,5 +1,7 @@ #include +#include + namespace llarp { template <> diff --git a/llarp/util/ini.cpp b/llarp/util/ini.cpp index 3ab314515..0f7c4bb69 100644 --- a/llarp/util/ini.cpp +++ b/llarp/util/ini.cpp @@ -4,6 +4,10 @@ #include #include +#ifdef LoadString +#undef LoadString +#endif + namespace llarp { bool diff --git a/llarp/util/threadpool.cpp b/llarp/util/threadpool.cpp index 8069d0356..93244532c 100644 --- a/llarp/util/threadpool.cpp +++ b/llarp/util/threadpool.cpp @@ -61,7 +61,7 @@ llarp_threadpool_queue_job(struct llarp_threadpool *pool, { while(!pool->impl->tryAddJob(std::bind(job.work, job.user))) { - ::usleep(1000); + std::this_thread::sleep_for(std::chrono::microseconds(1000)); } } else