diff --git a/api/baseapi.cpp b/api/baseapi.cpp index 71a4b6d1..1861b0ef 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -57,12 +57,14 @@ #ifdef _WIN32 #include #include +#ifdef _MSC_VER #include "mathfix.h" +#endif // _MSC_VER #else #include #include #include -#endif +#endif // _WIN32 #if !defined(VERSION) #include "version.h" diff --git a/api/pdfrenderer.cpp b/api/pdfrenderer.cpp index cf0d1e31..f2cd3ad8 100644 --- a/api/pdfrenderer.cpp +++ b/api/pdfrenderer.cpp @@ -14,7 +14,7 @@ #include "version.h" #endif -#ifdef _WIN32 +#ifdef _MSC_VER #include "mathfix.h" #endif diff --git a/ccutil/genericvector.h b/ccutil/genericvector.h index 32b63d72..92f6c71f 100644 --- a/ccutil/genericvector.h +++ b/ccutil/genericvector.h @@ -23,6 +23,10 @@ #include #include #include +/* #ifdef MINGW +#include +#endif // MINGW +*/ #include "tesscallback.h" #include "errcode.h" @@ -911,7 +915,7 @@ int GenericVector::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 diff --git a/ccutil/platform.h b/ccutil/platform.h index a50e9d78..4f611df4 100644 --- a/ccutil/platform.h +++ b/ccutil/platform.h @@ -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) diff --git a/configure.ac b/configure.ac index 82b3d0a0..a8c1fe0a 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/cube/bmp_8.cpp b/cube/bmp_8.cpp index 4e5c9b7f..33433538 100644 --- a/cube/bmp_8.cpp +++ b/cube/bmp_8.cpp @@ -23,17 +23,12 @@ #include #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(0.5f + diff --git a/cube/feature_chebyshev.cpp b/cube/feature_chebyshev.cpp index eeba8757..c00bbdf8 100644 --- a/cube/feature_chebyshev.cpp +++ b/cube/feature_chebyshev.cpp @@ -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)