# HG changeset patch # User Sebastien Jodogne # Date 1523985567 -7200 # Node ID 6d5e36e1256f15b1b448ffb620c42e010058e904 # Parent 9f325c6319732c6ff7ba043210cf90cb63981ca5 fix diff -r 9f325c631973 -r 6d5e36e1256f Core/Endianness.h --- a/Core/Endianness.h Tue Apr 17 21:01:08 2018 +0200 +++ b/Core/Endianness.h Tue Apr 17 19:19:27 2018 +0200 @@ -69,7 +69,7 @@ # define be32toh(x) __builtin_bswap32(x) # define be64toh(x) __builtin_bswap64(x) # else -// MinGW <= 4.2, we must manually implement the byte swapping +// MinGW <= 4.2, we must manually implement the byte swapping (*) # define ORTHANC_HAS_BUILTIN_BYTE_SWAP 0 # define be16toh(x) __orthanc_bswap16(x) # define be32toh(x) __orthanc_bswap32(x) @@ -170,7 +170,9 @@ static_cast(p[7])); } -#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) +#if defined(_WIN32) +// Implemented above (*) +#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) # if __BYTE_ORDER == __LITTLE_ENDIAN # define be16toh(x) __orthanc_bswap16(x) # define be32toh(x) __orthanc_bswap32(x) diff -r 9f325c631973 -r 6d5e36e1256f INSTALL --- a/INSTALL Tue Apr 17 21:01:08 2018 +0200 +++ b/INSTALL Tue Apr 17 19:19:27 2018 +0200 @@ -95,18 +95,13 @@ Cross-Compilation for Windows under GNU/Linux --------------------------------------------- -To cross-compile Windows binaries under Linux using MinGW, please use -the following command: +To cross-compile Windows binaries under Linux using MinGW-W64, please +use the following command: # cd ~/OrthancBuild -# cmake -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGW-W64-Toolchain32.cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_DCMTK_360=ON -DUSE_LEGACY_JSONCPP=ON ~/Orthanc +# cmake -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGW-W64-Toolchain32.cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DUSE_DCMTK_360=ON -DCMAKE_BUILD_TYPE=Debug ~/Orthanc # make - +For older MinGW32, use the following CMake invokation: -Native Windows build with MinGW (VERY SLOW) -------------------------------------------- - -# cd [...]\OrthancBuild -# cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug [...]\Orthanc -# mingw32-make +# cmake -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGWToolchain.cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_DCMTK_360=ON -DUSE_LEGACY_JSONCPP=ON ~/Orthanc diff -r 9f325c631973 -r 6d5e36e1256f Resources/CMake/DcmtkConfiguration.cmake --- a/Resources/CMake/DcmtkConfiguration.cmake Tue Apr 17 21:01:08 2018 +0200 +++ b/Resources/CMake/DcmtkConfiguration.cmake Tue Apr 17 19:19:27 2018 +0200 @@ -278,7 +278,6 @@ ) if (CMAKE_COMPILER_IS_GNUCXX AND - DCMTK_PATCH_MINGW64 AND USE_DCMTK_360) # This is a patch for MinGW64 execute_process( diff -r 9f325c631973 -r 6d5e36e1256f Resources/Patches/dcmtk-3.6.0-mingw64.patch --- a/Resources/Patches/dcmtk-3.6.0-mingw64.patch Tue Apr 17 21:01:08 2018 +0200 +++ b/Resources/Patches/dcmtk-3.6.0-mingw64.patch Tue Apr 17 19:19:27 2018 +0200 @@ -6,7 +6,7 @@ { if (file_) fclose(); -#ifdef _WIN32 -+#if 0 ++#if defined(_WIN32) && !defined(__MINGW64_VERSION_MAJOR) file_ = _popen(command, modes); #else file_ = :: popen(command, modes); @@ -15,8 +15,7 @@ if (popened_) { -#ifdef _WIN32 -+#if 0 ++#if defined(_WIN32) && !defined(__MINGW64_VERSION_MAJOR) result = _pclose(file_); #else result = :: pclose(file_); -Only in dcmtk-3.6.0/ofstd/include/dcmtk/ofstd: offile.h~