Skip to content

Commit

Permalink
fix mingw build issues
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@995 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
zdenop@gmail.com committed Jan 18, 2014
1 parent ff5fb7f commit ef3b1d9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
4 changes: 3 additions & 1 deletion api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@
#ifdef _WIN32
#include <windows.h>
#include <stdlib.h>
#ifdef _MSC_VER
#include "mathfix.h"
#endif // _MSC_VER
#else
#include <dirent.h>
#include <libgen.h>
#include <string.h>
#endif
#endif // _WIN32

#if !defined(VERSION)
#include "version.h"
Expand Down
2 changes: 1 addition & 1 deletion api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "version.h"
#endif

#ifdef _WIN32
#ifdef _MSC_VER
#include "mathfix.h"
#endif

Expand Down
6 changes: 5 additions & 1 deletion ccutil/genericvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
/* #ifdef MINGW
#include <pthread.h>
#endif // MINGW
*/

#include "tesscallback.h"
#include "errcode.h"
Expand Down Expand Up @@ -911,7 +915,7 @@ int GenericVector<T>::choose_nth_item(int target_index, int start, int end,
}
}
// Place the pivot at start.
#if defined(_MSC_VER) || defined(ANDROID) // TODO(zdenop): check this
#ifndef rand_r // _MSC_VER, ANDROID
srand(*seed);
#define rand_r(seed) rand()
#endif // _MSC_VER
Expand Down
6 changes: 6 additions & 0 deletions ccutil/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
#define SIGNED signed
#endif

#ifdef _WIN32
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif

#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(TESS_EXPORTS)
#define TESS_API __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

AC_PREREQ(2.50)
AC_INIT([tesseract], [3.03], [http://code.google.com/p/tesseract-ocr/issues/list])
${CXXFLAGS=""}
CXXFLAGS=""
AC_CONFIG_MACRO_DIR([m4])
AC_REVISION([$Revision$])
AC_CONFIG_AUX_DIR(config)
Expand Down
7 changes: 1 addition & 6 deletions cube/bmp_8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@
#include <algorithm>
#include "bmp_8.h"
#include "con_comp.h"
#include "platform.h"
#ifdef USE_STD_NAMESPACE
using std::min;
using std::max;
#endif

#ifdef _WIN32
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif

namespace tesseract {

const int Bmp8::kDeslantAngleCount = (1 + static_cast<int>(0.5f +
Expand Down
6 changes: 0 additions & 6 deletions cube/feature_chebyshev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
#include "const.h"
#include "char_samp.h"

#ifdef _WIN32
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif

namespace tesseract {

FeatureChebyshev::FeatureChebyshev(TuningParams *params)
Expand Down

0 comments on commit ef3b1d9

Please sign in to comment.