Skip to content

Commit

Permalink
[freeimage] Fixed link errors with libTIFF (microsoft#13720)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReclif authored Sep 28, 2020
1 parent dcc7ddc commit 7065866
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ports/freeimage/CONTROL
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ports/freeimage/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 7065866

Please sign in to comment.