diff options
author | Stefan Weil <sw@weilnetz.de> | 2018-02-26 11:34:14 +0100 |
---|---|---|
committer | Stefan Weil <sw@weilnetz.de> | 2018-05-25 08:42:50 +0200 |
commit | 924405d5b31b9ff37a67abd1e294892758f6379a (patch) | |
tree | a74b1167d15ff221fa76b5020b10109ee1f1b2a0 /libtiff | |
parent | 58a898cb4459055bb488ca815c23b880c242a27d (diff) | |
download | libtiff-git-924405d5b31b9ff37a67abd1e294892758f6379a.tar.gz |
Remove builtin support for GUI warning and error message boxes
Now warnings always go to the console by default unless applications
define their own warning and error handlers.
GUI applications (and Windows CE) are required to define such handlers.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'libtiff')
-rw-r--r-- | libtiff/tif_win32.c | 39 | ||||
-rw-r--r-- | libtiff/tif_wince.c | 3 |
2 files changed, 0 insertions, 42 deletions
diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c index cde4f6dc..088880e7 100644 --- a/libtiff/tif_win32.c +++ b/libtiff/tif_win32.c @@ -405,60 +405,21 @@ _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c) static void Win32WarningHandler(const char* module, const char* fmt, va_list ap) { -#ifndef TIF_PLATFORM_CONSOLE - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Warning"; - LPCTSTR szDefaultModule = "LIBTIFF"; - LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module; - SIZE_T nBufSize = (strlen(szTmpModule) + - strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char); - - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL) - return; - sprintf(szTitle, szTitleText, szTmpModule); - szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char); - vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap); - MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION); - LocalFree(szTitle); - - return; -#else if (module != NULL) fprintf(stderr, "%s: ", module); fprintf(stderr, "Warning, "); vfprintf(stderr, fmt, ap); fprintf(stderr, ".\n"); -#endif } TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler; static void Win32ErrorHandler(const char* module, const char* fmt, va_list ap) { -#ifndef TIF_PLATFORM_CONSOLE - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Error"; - LPCTSTR szDefaultModule = "LIBTIFF"; - LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module; - SIZE_T nBufSize = (strlen(szTmpModule) + - strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char); - - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL) - return; - sprintf(szTitle, szTitleText, szTmpModule); - szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char); - vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap); - MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION); - LocalFree(szTitle); - return; -#else if (module != NULL) fprintf(stderr, "%s: ", module); vfprintf(stderr, fmt, ap); fprintf(stderr, ".\n"); -#endif } TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; diff --git a/libtiff/tif_wince.c b/libtiff/tif_wince.c index 5bd7daf5..b3b168f1 100644 --- a/libtiff/tif_wince.c +++ b/libtiff/tif_wince.c @@ -34,9 +34,6 @@ #include "tiffiop.h" #include <windows.h> -/* Turn off console support on Windows CE. */ -#undef TIF_PLATFORM_CONSOLE - COMPILATION SHOULD FAIL This file is not yet updated to reflect changes in LibTiff 4.0. If you have the opportunity to update and test this file, please contact LibTiff folks |