changeset 141:3e9cced85a5b

fix build for MSVC 2015
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 02 Mar 2024 11:10:50 +0100
parents 40efe821932a
children c6edc5caca7a
files Aws/AwsS3StoragePlugin.cpp Aws/CMakeLists.txt Aws/holy-build-box-internal.sh
diffstat 3 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Aws/AwsS3StoragePlugin.cpp	Fri Mar 01 16:17:51 2024 +0100
+++ b/Aws/AwsS3StoragePlugin.cpp	Sat Mar 02 11:10:50 2024 +0100
@@ -416,24 +416,26 @@
       #endif
       va_end(tmp_args);
 
-      char outputBuff[requiredLength];
+      assert(requiredLength > 0);
+      std::string outputBuff;
+      outputBuff.resize(requiredLength);
       #ifdef _WIN32
-          vsnprintf_s(outputBuff, requiredLength, _TRUNCATE, formatStr, args);
+          vsnprintf_s(&outputBuff[0], requiredLength, _TRUNCATE, formatStr, args);
       #else
-          vsnprintf(outputBuff, requiredLength, formatStr, args);
+          vsnprintf(&outputBuff[0], requiredLength, formatStr, args);
       #endif // _WIN32
 
       if (logLevel == Aws::Utils::Logging::LogLevel::Debug || logLevel == Aws::Utils::Logging::LogLevel::Trace)
       {
-        LOG(INFO) << reinterpret_cast<const char*>(&outputBuff[0]);
+        LOG(INFO) << outputBuff.c_str();
       }
       else if (logLevel == Aws::Utils::Logging::LogLevel::Warn)
       {
-        LOG(WARNING) << reinterpret_cast<const char*>(&outputBuff[0]);
+        LOG(WARNING) << outputBuff.c_str();
       }
       else
       {
-        LOG(ERROR) << reinterpret_cast<const char*>(&outputBuff[0]);
+        LOG(ERROR) << outputBuff.c_str();
       }
 
       va_end(args);
--- a/Aws/CMakeLists.txt	Fri Mar 01 16:17:51 2024 +0100
+++ b/Aws/CMakeLists.txt	Sat Mar 02 11:10:50 2024 +0100
@@ -81,6 +81,7 @@
   set(ENABLE_MODULE_DICOM OFF)
   set(ENABLE_MODULE_IMAGES OFF)
   set(ENABLE_MODULE_JOBS OFF)
+  set(ENABLE_OPENSSL_ENGINES ON)  # Necessary since OpenSSL 3.1.x
   set(ENABLE_WEB_CLIENT ON)  # Access options related to curl
   set(ORTHANC_FRAMEWORK_PLUGIN ON)
 
--- a/Aws/holy-build-box-internal.sh	Fri Mar 01 16:17:51 2024 +0100
+++ b/Aws/holy-build-box-internal.sh	Sat Mar 02 11:10:50 2024 +0100
@@ -49,7 +49,9 @@
       -DCMAKE_BUILD_TYPE=$1 -DSTATIC_BUILD=ON
 
 # Use only 2 processes (not `nproc`), as this is a very heavy compilation
-make -j2
+# make -j2
+
+make -j`nproc --all`
 
 ./UnitTests