Skip to content

Commit f94b3fd

Browse files
committed
Remove code for _MSC_VER < 1900
Tesseract does not support Visual C++ older than Visual Studio 2015. Signed-off-by: Stefan Weil <[email protected]>
1 parent c375f4f commit f94b3fd

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

src/ccutil/platform.h

-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
#define ultoa _ultoa
3333
#endif /* __GNUC__ */
3434
#define SIGNED
35-
#if defined(_MSC_VER)
36-
#if (_MSC_VER < 1900)
37-
#define snprintf _snprintf
38-
#endif
39-
#endif /* defined(_MSC_VER) */
4035
#else
4136
#include <climits>
4237
#ifndef PATH_MAX

src/lstm/weightmatrix.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828
namespace tesseract {
2929

30-
#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(ANDROID)
30+
#if defined(ANDROID)
3131
static inline double log2(double n) {
3232
return log(n) / log(2.0);
3333
}
34-
#endif // _MSC_VER
34+
#endif // ANDROID
3535

3636
// Number of iterations after which the correction effectively becomes unity.
3737
const int kAdamCorrectionIterations = 200000;

src/viewer/svutil.h

-8
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,8 @@
2525
#define TESSERACT_VIEWER_SVUTIL_H_
2626

2727
#ifdef _WIN32
28-
#ifndef __GNUC__
2928
#include <windows.h>
3029
#include "platform.h"
31-
#if defined(_MSC_VER) && _MSC_VER < 1900
32-
#define snprintf _snprintf
33-
#endif
34-
#else
35-
#include "platform.h"
36-
#include <windows.h>
37-
#endif
3830
#else
3931
#include <pthread.h>
4032
#include <semaphore.h>

src/wordrec/language_model.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ namespace tesseract {
4343
class LMPainPoints;
4444
struct FontInfo;
4545

46-
#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(ANDROID)
46+
#if defined(ANDROID)
4747
static inline double log2(double n) {
4848
return log(n) / log(2.0);
4949
}
50-
#endif // _MSC_VER
50+
#endif // ANDROID
5151

5252
const float LanguageModel::kMaxAvgNgramCost = 25.0f;
5353

0 commit comments

Comments
 (0)