mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
windowscodecs: Don't fail if the TIFF library doesn't have the functions to disable warnings.
This commit is contained in:
parent
e67f6c2364
commit
0c6ac865bd
1 changed files with 6 additions and 7 deletions
|
@ -67,8 +67,6 @@ MAKE_FUNCPTR(TIFFReadEncodedStrip);
|
|||
MAKE_FUNCPTR(TIFFReadEncodedTile);
|
||||
MAKE_FUNCPTR(TIFFSetDirectory);
|
||||
MAKE_FUNCPTR(TIFFSetField);
|
||||
MAKE_FUNCPTR(TIFFSetWarningHandler);
|
||||
MAKE_FUNCPTR(TIFFSetWarningHandlerExt);
|
||||
MAKE_FUNCPTR(TIFFWriteDirectory);
|
||||
MAKE_FUNCPTR(TIFFWriteScanline);
|
||||
#undef MAKE_FUNCPTR
|
||||
|
@ -82,6 +80,8 @@ static void *load_libtiff(void)
|
|||
if (!libtiff_handle &&
|
||||
(libtiff_handle = wine_dlopen(SONAME_LIBTIFF, RTLD_NOW, NULL, 0)) != NULL)
|
||||
{
|
||||
void * (*pTIFFSetWarningHandler)(void *);
|
||||
void * (*pTIFFSetWarningHandlerExt)(void *);
|
||||
|
||||
#define LOAD_FUNCPTR(f) \
|
||||
if((p##f = wine_dlsym(libtiff_handle, #f, NULL, 0)) == NULL) { \
|
||||
|
@ -101,19 +101,18 @@ static void *load_libtiff(void)
|
|||
LOAD_FUNCPTR(TIFFReadEncodedTile);
|
||||
LOAD_FUNCPTR(TIFFSetDirectory);
|
||||
LOAD_FUNCPTR(TIFFSetField);
|
||||
LOAD_FUNCPTR(TIFFSetWarningHandler);
|
||||
LOAD_FUNCPTR(TIFFSetWarningHandlerExt);
|
||||
LOAD_FUNCPTR(TIFFWriteDirectory);
|
||||
LOAD_FUNCPTR(TIFFWriteScanline);
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
if ((pTIFFSetWarningHandler = wine_dlsym(libtiff_handle, "TIFFSetWarningHandler", NULL, 0)))
|
||||
pTIFFSetWarningHandler(NULL);
|
||||
if ((pTIFFSetWarningHandlerExt = wine_dlsym(libtiff_handle, "TIFFSetWarningHandlerExt", NULL, 0)))
|
||||
pTIFFSetWarningHandlerExt(NULL);
|
||||
}
|
||||
|
||||
result = libtiff_handle;
|
||||
|
||||
pTIFFSetWarningHandler(NULL);
|
||||
pTIFFSetWarningHandlerExt(NULL);
|
||||
|
||||
LeaveCriticalSection(&init_tiff_cs);
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue