[freeimage] Fixed link errors with libTIFF (#13720)

This commit is contained in:
TheReclif 2020-09-28 02:45:49 +02:00 committed by GitHub
parent dcc7ddcd5c
commit 70658669cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 1 deletions

View File

@ -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

View File

@ -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})

View File

@ -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;