Skip to content

Commit

Permalink
Add missing include statements for Windows build
Browse files Browse the repository at this point in the history
The last commits which removed BOOL8 had broken the Windows build.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Mar 31, 2019
1 parent 802f42e commit c150b98
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 52 deletions.
12 changes: 7 additions & 5 deletions src/ccutil/ccutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@
#ifndef TESSERACT_CCUTIL_CCUTIL_H_
#define TESSERACT_CCUTIL_CCUTIL_H_

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

#include "ambigs.h"
#include "errcode.h"
#include "strngs.h"
#include "params.h"
#include "unicharset.h"

#ifndef _WIN32
#include <pthread.h>
#include <semaphore.h>
#endif

namespace tesseract {

class CCUtilMutex {
Expand Down
3 changes: 2 additions & 1 deletion src/ccutil/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* File: fileio.cpp
* Description: File I/O utilities.
* Author: Samuel Charron
* Created: Tuesday, July 9, 2013
*
* (C) Copyright 2013, Google Inc.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
Expand All @@ -14,7 +13,9 @@
* language governing permissions and limitations under the License.
*
**********************************************************************/

#ifdef _WIN32
#include <windows.h> // BOOL, ...
#ifndef unlink
#include <io.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions src/ccutil/params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "genericvector.h"
#include "tprintf.h"
#include "params.h"
#include "platform.h" // MAX_PATH

#define PLUS '+' //flag states
#define MINUS '-'
Expand Down
91 changes: 45 additions & 46 deletions src/ccutil/platform.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
///////////////////////////////////////////////////////////////////////
// File: platform.h
// Description: Place holder
// Author:
// Created:
//
// (C) Copyright 2006, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -22,58 +20,59 @@

#define DLLSYM
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif /* NOMINMAX */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifdef __GNUC__
#define ultoa _ultoa
#endif /* __GNUC__ */
#define SIGNED
#else
#ifdef __cplusplus
#include <climits>
#else /* C compiler*/
#include <limits.h>
#endif /* __cplusplus */
#ifndef PATH_MAX
#define MAX_PATH 4096
# include <windows.h> // MAX_PATH
# ifndef NOMINMAX
# define NOMINMAX
# endif /* NOMINMAX */
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# ifdef __GNUC__
# define ultoa _ultoa
# endif /* __GNUC__ */
# define SIGNED
#else
#define MAX_PATH PATH_MAX
#endif
#define SIGNED signed
# ifdef __cplusplus
# include <climits>
# else /* C compiler*/
# include <limits.h>
# endif /* __cplusplus */
# ifndef PATH_MAX
# define MAX_PATH 4096
# else
# define MAX_PATH PATH_MAX
# endif
# define SIGNED signed
#endif

#if defined(_WIN32) || defined(__CYGWIN__)
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
# ifndef M_PI
# define M_PI 3.14159265358979323846
# endif
#endif

#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(TESS_EXPORTS)
#define TESS_API __declspec(dllexport)
#elif defined(TESS_IMPORTS)
#define TESS_API __declspec(dllimport)
#else
#define TESS_API
#endif
#define TESS_LOCAL
# if defined(TESS_EXPORTS)
# define TESS_API __declspec(dllexport)
# elif defined(TESS_IMPORTS)
# define TESS_API __declspec(dllimport)
# else
# define TESS_API
# endif
# define TESS_LOCAL
#else
#if __GNUC__ >= 4
#if defined(TESS_EXPORTS) || defined(TESS_IMPORTS)
#define TESS_API __attribute__ ((visibility ("default")))
#define TESS_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define TESS_API
#define TESS_LOCAL
#endif
#else
#define TESS_API
#define TESS_LOCAL
#endif
# if __GNUC__ >= 4
# if defined(TESS_EXPORTS) || defined(TESS_IMPORTS)
# define TESS_API __attribute__((visibility("default")))
# define TESS_LOCAL __attribute__((visibility("hidden")))
# else
# define TESS_API
# define TESS_LOCAL
# endif
# else
# define TESS_API
# define TESS_LOCAL
# endif
#endif

#endif // TESSERACT_CCUTIL_PLATFORM_H_
1 change: 1 addition & 0 deletions src/classify/fpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "fpoint.h"
#include <cstdio>
#include <cmath>
#include "platform.h" // M_PI

/*----------------------------------------------------------------------------
Public Code
Expand Down

0 comments on commit c150b98

Please sign in to comment.