Skip to content

Commit

Permalink
Only include windows.h using host.h
Browse files Browse the repository at this point in the history
host.h sets the macros NOMINMAX and WIN32_LEAN_AND_MEAN which must be
set before including windows.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Apr 22, 2019
1 parent 53f1265 commit 708511a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/api/altorenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

#include <memory>
#include <sstream> // for std::stringstream
#include "baseapi.h"
#ifdef _WIN32
# include <windows.h> // MultiByteToWideChar, ...
# include "host.h" // windows.h for MultiByteToWideChar, ...
#endif
#include "baseapi.h"
#include "renderer.h"

namespace tesseract {
Expand Down
4 changes: 2 additions & 2 deletions src/api/hocrrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <locale> // for std::locale::classic
#include <memory> // for std::unique_ptr
#include <sstream> // for std::stringstream
#include "baseapi.h" // for TessBaseAPI
#ifdef _WIN32
# include <windows.h> // MultiByteToWideChar, ...
# include "host.h" // windows.h for MultiByteToWideChar, ...
#endif
#include "baseapi.h" // for TessBaseAPI
#include "renderer.h"
#include "tesseractclass.h" // for Tesseract

Expand Down
7 changes: 4 additions & 3 deletions src/ccutil/ccutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
#ifndef TESSERACT_CCUTIL_CCUTIL_H_
#define TESSERACT_CCUTIL_CCUTIL_H_

#ifdef _WIN32
#include <windows.h> // HANDLE, ...
#else
#ifndef _WIN32
#include <pthread.h>
#include <semaphore.h>
#endif

#include "ambigs.h"
#include "errcode.h"
#ifdef _WIN32
#include "host.h" // windows.h for HANDLE, ...
#endif
#include "strngs.h"
#include "params.h"
#include "unicharset.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ccutil/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
**********************************************************************/

#ifdef _WIN32
#include <windows.h> // BOOL, ...
#ifndef unlink
#include <io.h>
#endif
Expand All @@ -30,6 +29,7 @@

#include "errcode.h"
#include "fileio.h"
#include "host.h" // includes windows.h for BOOL, ...
#include "tprintf.h"

namespace tesseract {
Expand Down

0 comments on commit 708511a

Please sign in to comment.