From 10773727194ffa8e344d2eb2d19ec968ae7e4cd9 Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Mon, 26 Feb 2024 20:18:24 +0000 Subject: [PATCH] HPCC-31355 Windows build failing in GH Actions Older versions of MS STL is missing an implementation for "_Thrd_sleep_for" Signed-off-by: Gordon Smith --- system/jlib/jtrace.cpp | 7 ++++++- vcpkg.json.in | 17 +++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/system/jlib/jtrace.cpp b/system/jlib/jtrace.cpp index 4c3c811b201..9014c7bf282 100644 --- a/system/jlib/jtrace.cpp +++ b/system/jlib/jtrace.cpp @@ -15,7 +15,6 @@ limitations under the License. ############################################################################## */ - #include "opentelemetry/trace/semantic_conventions.h" //known span defines #include "opentelemetry/context/propagation/global_propagator.h" // context::propagation::GlobalTextMapPropagator::GetGlobalPropagator #include "opentelemetry/sdk/trace/tracer_provider_factory.h" //opentelemetry::sdk::trace::TracerProviderFactory::Create(context) @@ -1425,3 +1424,9 @@ ITraceManager & queryTraceManager() { return *theTraceManager.query([] () { return new CTraceManager; }); //throws if not initialized } + +#if WIN32 && _MSC_VER < 1939 // _MSC_VER < VS 2022 17.9 +extern "C" void __stdcall _Thrd_sleep_for(const unsigned long ms) noexcept { // suspend current thread for `ms` milliseconds + Sleep(ms); +} +#endif diff --git a/vcpkg.json.in b/vcpkg.json.in index 199c2b42bde..535e9bb3dbe 100644 --- a/vcpkg.json.in +++ b/vcpkg.json.in @@ -168,6 +168,15 @@ "name": "openssl", "platform": "@VCPKG_OPENSSL@" }, + { + "name": "opentelemetry-cpp", + "default-features": false, + "features": [ + "otlp", + "otlp-http", + "otlp-grpc" + ] + }, { "name": "python3", "platform": "@VCPKG_PYTHON3@ & windows" @@ -192,14 +201,6 @@ { "name": "zlib", "platform": "@VCPKG_ZLIB@" - }, - { - "name": "opentelemetry-cpp", - "features": [ - "otlp", - "otlp-http", - "otlp-grpc" - ] } ] } \ No newline at end of file