Skip to content

Commit c150b98

Browse files
committed
Add missing include statements for Windows build
The last commits which removed BOOL8 had broken the Windows build. Signed-off-by: Stefan Weil <[email protected]>
1 parent 802f42e commit c150b98

File tree

5 files changed

+56
-52
lines changed

5 files changed

+56
-52
lines changed

src/ccutil/ccutil.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@
1919
#ifndef TESSERACT_CCUTIL_CCUTIL_H_
2020
#define TESSERACT_CCUTIL_CCUTIL_H_
2121

22+
#ifdef _WIN32
23+
#include <windows.h> // HANDLE, ...
24+
#else
25+
#include <pthread.h>
26+
#include <semaphore.h>
27+
#endif
28+
2229
#include "ambigs.h"
2330
#include "errcode.h"
2431
#include "strngs.h"
2532
#include "params.h"
2633
#include "unicharset.h"
2734

28-
#ifndef _WIN32
29-
#include <pthread.h>
30-
#include <semaphore.h>
31-
#endif
32-
3335
namespace tesseract {
3436

3537
class CCUtilMutex {

src/ccutil/fileio.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: fileio.cpp
33
* Description: File I/O utilities.
44
* Author: Samuel Charron
5-
* Created: Tuesday, July 9, 2013
65
*
76
* (C) Copyright 2013, Google Inc.
87
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
@@ -14,7 +13,9 @@
1413
* language governing permissions and limitations under the License.
1514
*
1615
**********************************************************************/
16+
1717
#ifdef _WIN32
18+
#include <windows.h> // BOOL, ...
1819
#ifndef unlink
1920
#include <io.h>
2021
#endif

src/ccutil/params.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "genericvector.h"
2424
#include "tprintf.h"
2525
#include "params.h"
26+
#include "platform.h" // MAX_PATH
2627

2728
#define PLUS '+' //flag states
2829
#define MINUS '-'

src/ccutil/platform.h

+45-46
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
///////////////////////////////////////////////////////////////////////
22
// File: platform.h
33
// Description: Place holder
4-
// Author:
5-
// Created:
64
//
75
// (C) Copyright 2006, Google Inc.
86
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,58 +20,59 @@
2220

2321
#define DLLSYM
2422
#ifdef _WIN32
25-
#ifndef NOMINMAX
26-
#define NOMINMAX
27-
#endif /* NOMINMAX */
28-
#ifndef WIN32_LEAN_AND_MEAN
29-
#define WIN32_LEAN_AND_MEAN
30-
#endif
31-
#ifdef __GNUC__
32-
#define ultoa _ultoa
33-
#endif /* __GNUC__ */
34-
#define SIGNED
35-
#else
36-
#ifdef __cplusplus
37-
#include <climits>
38-
#else /* C compiler*/
39-
#include <limits.h>
40-
#endif /* __cplusplus */
41-
#ifndef PATH_MAX
42-
#define MAX_PATH 4096
23+
# include <windows.h> // MAX_PATH
24+
# ifndef NOMINMAX
25+
# define NOMINMAX
26+
# endif /* NOMINMAX */
27+
# ifndef WIN32_LEAN_AND_MEAN
28+
# define WIN32_LEAN_AND_MEAN
29+
# endif
30+
# ifdef __GNUC__
31+
# define ultoa _ultoa
32+
# endif /* __GNUC__ */
33+
# define SIGNED
4334
#else
44-
#define MAX_PATH PATH_MAX
45-
#endif
46-
#define SIGNED signed
35+
# ifdef __cplusplus
36+
# include <climits>
37+
# else /* C compiler*/
38+
# include <limits.h>
39+
# endif /* __cplusplus */
40+
# ifndef PATH_MAX
41+
# define MAX_PATH 4096
42+
# else
43+
# define MAX_PATH PATH_MAX
44+
# endif
45+
# define SIGNED signed
4746
#endif
4847

4948
#if defined(_WIN32) || defined(__CYGWIN__)
50-
#ifndef M_PI
51-
#define M_PI 3.14159265358979323846
52-
#endif
49+
# ifndef M_PI
50+
# define M_PI 3.14159265358979323846
51+
# endif
5352
#endif
5453

5554
#if defined(_WIN32) || defined(__CYGWIN__)
56-
#if defined(TESS_EXPORTS)
57-
#define TESS_API __declspec(dllexport)
58-
#elif defined(TESS_IMPORTS)
59-
#define TESS_API __declspec(dllimport)
60-
#else
61-
#define TESS_API
62-
#endif
63-
#define TESS_LOCAL
55+
# if defined(TESS_EXPORTS)
56+
# define TESS_API __declspec(dllexport)
57+
# elif defined(TESS_IMPORTS)
58+
# define TESS_API __declspec(dllimport)
59+
# else
60+
# define TESS_API
61+
# endif
62+
# define TESS_LOCAL
6463
#else
65-
#if __GNUC__ >= 4
66-
#if defined(TESS_EXPORTS) || defined(TESS_IMPORTS)
67-
#define TESS_API __attribute__ ((visibility ("default")))
68-
#define TESS_LOCAL __attribute__ ((visibility ("hidden")))
69-
#else
70-
#define TESS_API
71-
#define TESS_LOCAL
72-
#endif
73-
#else
74-
#define TESS_API
75-
#define TESS_LOCAL
76-
#endif
64+
# if __GNUC__ >= 4
65+
# if defined(TESS_EXPORTS) || defined(TESS_IMPORTS)
66+
# define TESS_API __attribute__((visibility("default")))
67+
# define TESS_LOCAL __attribute__((visibility("hidden")))
68+
# else
69+
# define TESS_API
70+
# define TESS_LOCAL
71+
# endif
72+
# else
73+
# define TESS_API
74+
# define TESS_LOCAL
75+
# endif
7776
#endif
7877

7978
#endif // TESSERACT_CCUTIL_PLATFORM_H_

src/classify/fpoint.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "fpoint.h"
2121
#include <cstdio>
2222
#include <cmath>
23+
#include "platform.h" // M_PI
2324

2425
/*----------------------------------------------------------------------------
2526
Public Code

0 commit comments

Comments
 (0)