From 70658669cc038c3016b795b60964e60747a3eb18 Mon Sep 17 00:00:00 2001 From: TheReclif <17992687+TheReclif@users.noreply.github.com> Date: Mon, 28 Sep 2020 02:45:49 +0200 Subject: [PATCH] [freeimage] Fixed link errors with libTIFF (#13720) --- ports/freeimage/CONTROL | 2 +- ports/freeimage/portfile.cmake | 1 + ...rride-libtiff-warning-error-handlers.patch | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ports/freeimage/use-functions-to-override-libtiff-warning-error-handlers.patch diff --git a/ports/freeimage/CONTROL b/ports/freeimage/CONTROL index 94c6b89691..fea08c2fab 100644 --- a/ports/freeimage/CONTROL +++ b/ports/freeimage/CONTROL @@ -1,6 +1,6 @@ Source: freeimage Version: 3.18.0 -Port-Version: 15 +Port-Version: 16 Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp (!uwp), libraw, jxrlib, openexr Homepage: https://sourceforge.net/projects/freeimage/ Description: Support library for graphics image formats diff --git a/ports/freeimage/portfile.cmake b/ports/freeimage/portfile.cmake index 50e0148bed..ce1b86821c 100644 --- a/ports/freeimage/portfile.cmake +++ b/ports/freeimage/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_from_sourceforge( use-freeimage-config-include.patch fix-function-overload.patch use-typedef-as-already-declared.patch + use-functions-to-override-libtiff-warning-error-handlers.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/freeimage/use-functions-to-override-libtiff-warning-error-handlers.patch b/ports/freeimage/use-functions-to-override-libtiff-warning-error-handlers.patch new file mode 100644 index 0000000000..270331e26c --- /dev/null +++ b/ports/freeimage/use-functions-to-override-libtiff-warning-error-handlers.patch @@ -0,0 +1,31 @@ +diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp +index a9fcf0e..b1f7b32 100644 +--- a/Source/FreeImage/PluginTIFF.cpp ++++ b/Source/FreeImage/PluginTIFF.cpp +@@ -258,7 +258,7 @@ static void + msdosWarningHandler(const char* module, const char* fmt, va_list ap) { + } + +-TIFFErrorHandler _TIFFwarningHandler = msdosWarningHandler; ++//TIFFErrorHandler _TIFFwarningHandler = msdosWarningHandler; + + static void + msdosErrorHandler(const char* module, const char* fmt, va_list ap) { +@@ -273,7 +273,7 @@ msdosErrorHandler(const char* module, const char* fmt, va_list ap) { + */ + } + +-TIFFErrorHandler _TIFFerrorHandler = msdosErrorHandler; ++//TIFFErrorHandler _TIFFerrorHandler = msdosErrorHandler; + + // ---------------------------------------------------------- + +@@ -2659,6 +2659,8 @@ InitTIFF(Plugin *plugin, int format_id) { + // Set up the callback for extended TIFF directory tag support (see XTIFF.cpp) + // Must be called before using libtiff + XTIFFInitialize(); ++ TIFFSetWarningHandler(msdosWarningHandler); ++ TIFFSetErrorHandler(msdosErrorHandler); + + plugin->format_proc = Format; + plugin->description_proc = Description;