changeset 3774:6d2b94698995

fix for MSVC 32bit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Mar 2020 09:01:55 +0100
parents df164cc69529
children 374e0c6c41d6
files Resources/CMake/DcmtkConfigurationStatic-3.6.5.cmake
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/DcmtkConfigurationStatic-3.6.5.cmake	Wed Mar 18 07:57:33 2020 +0100
+++ b/Resources/CMake/DcmtkConfigurationStatic-3.6.5.cmake	Wed Mar 18 09:01:55 2020 +0100
@@ -193,8 +193,16 @@
     -DDCMTK_LOG4CPLUS_AVOID_WIN32_FLS
     )
 
-  if (CMAKE_COMPILER_IS_GNUCXX)
-    # This is MinGW
+  if (CMAKE_COMPILER_IS_GNUCXX OR             # MinGW
+      "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")  # MSVC for 32bit (*)
+
+    # (*) With multithreaded logging enabled, Visual Studio 2008 fails
+    # with error: ".\dcmtk-3.6.5\oflog\libsrc\globinit.cc(422) : error
+    # C2664: 'dcmtk::log4cplus::thread::impl::tls_init' : cannot
+    # convert parameter 1 from 'void (__stdcall *)(void *)' to
+    # 'dcmtk::log4cplus::thread::impl::tls_init_cleanup_func_type'"
+    #   None of the functions with this name in scope match the target type
+
     add_definitions(
       -DDCMTK_LOG4CPLUS_SINGLE_THREADED
       )