Skip to content

Commit 75fdc08

Browse files
committed
win32: Check whether tiffio.h is available
The previous commit added a dependency on tiffio.h, so enable the new code only if that file is available. The code which conditionally defines HAVE_TIFFIO_H was already there although that macro was unused up to now. Signed-off-by: Stefan Weil <[email protected]>
1 parent 896e80d commit 75fdc08

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/tesseractmain.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "openclwrapper.h"
3434
#include "osdetect.h"
3535

36-
#if defined(_WIN32)
36+
#if defined(HAVE_TIFFIO_H) && defined(_WIN32)
3737

3838
#include <tiffio.h>
3939
#include <windows.h>
@@ -48,7 +48,7 @@ static void Win32WarningHandler(const char* module, const char* fmt,
4848
fprintf(stderr, ".\n");
4949
}
5050

51-
#endif /* _WIN32 */
51+
#endif /* HAVE_TIFFIO_H && _WIN32 */
5252

5353
void PrintVersionInfo() {
5454
char *versionStrP;
@@ -369,10 +369,10 @@ int main(int argc, char **argv) {
369369
int arg_i = 1;
370370
tesseract::PageSegMode pagesegmode = tesseract::PSM_AUTO;
371371

372-
#if defined(_WIN32)
372+
#if defined(HAVE_TIFFIO_H) && defined(_WIN32)
373373
/* Show libtiff warnings on console (not in GUI). */
374374
TIFFSetWarningHandler(Win32WarningHandler);
375-
#endif /* _WIN32 */
375+
#endif /* HAVE_TIFFIO_H && _WIN32 */
376376

377377
ParseArgs(argc, argv,
378378
&lang, &image, &outputbase, &datapath,

0 commit comments

Comments
 (0)