Skip to content

Commit

Permalink
win32: Check whether tiffio.h is available
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stweil committed Jul 17, 2016
1 parent 896e80d commit 75fdc08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/tesseractmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "openclwrapper.h"
#include "osdetect.h"

#if defined(_WIN32)
#if defined(HAVE_TIFFIO_H) && defined(_WIN32)

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

#endif /* _WIN32 */
#endif /* HAVE_TIFFIO_H && _WIN32 */

void PrintVersionInfo() {
char *versionStrP;
Expand Down Expand Up @@ -369,10 +369,10 @@ int main(int argc, char **argv) {
int arg_i = 1;
tesseract::PageSegMode pagesegmode = tesseract::PSM_AUTO;

#if defined(_WIN32)
#if defined(HAVE_TIFFIO_H) && defined(_WIN32)
/* Show libtiff warnings on console (not in GUI). */
TIFFSetWarningHandler(Win32WarningHandler);
#endif /* _WIN32 */
#endif /* HAVE_TIFFIO_H && _WIN32 */

ParseArgs(argc, argv,
&lang, &image, &outputbase, &datapath,
Expand Down

0 comments on commit 75fdc08

Please sign in to comment.