From 8ee5c865f1ed4dd83de1cbd903218e74aa8ced7f Mon Sep 17 00:00:00 2001 From: zdenop Date: Tue, 23 Apr 2019 20:19:54 +0200 Subject: [PATCH] MSVS support inttypes.h from VS 2015 --- src/ccstruct/blobbox.h | 1 - src/ccstruct/imagedata.cpp | 2 +- src/ccstruct/pdblock.cpp | 4 ++-- src/ccstruct/polyblk.cpp | 6 +++--- src/ccutil/host.h | 19 +------------------ src/dict/dawg.h | 1 - src/textord/colpartition.cpp | 1 + src/textord/tabfind.cpp | 2 +- 8 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/ccstruct/blobbox.h b/src/ccstruct/blobbox.h index 8e184b53..b5ea5505 100644 --- a/src/ccstruct/blobbox.h +++ b/src/ccstruct/blobbox.h @@ -25,7 +25,6 @@ #include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK #include "elst2.h" // for ELIST2_ITERATOR, ELIST2IZEH, ELIST2_LINK #include "errcode.h" // for ASSERT_HOST -#include "host.h" // for PRId32 #include "ocrblock.h" // for BLOCK #include "params.h" // for DoubleParam, double_VAR_H #include "pdblock.h" // for PDBLK diff --git a/src/ccstruct/imagedata.cpp b/src/ccstruct/imagedata.cpp index 58c301ab..3b2b74a5 100644 --- a/src/ccstruct/imagedata.cpp +++ b/src/ccstruct/imagedata.cpp @@ -33,11 +33,11 @@ #include "boxread.h" // for ReadMemBoxes #include "callcpp.h" // for window_wait #include "helpers.h" // for IntCastRounded, TRand, ClipToRange, Modulo -#include "host.h" // for PRId64 #include "rect.h" // for TBOX #include "scrollview.h" // for ScrollView, ScrollView::CYAN, ScrollView::NONE #include "serialis.h" // for TFile #include "tprintf.h" // for tprintf +#include // for PRId64 // Number of documents to read ahead while training. Doesn't need to be very // large. diff --git a/src/ccstruct/pdblock.cpp b/src/ccstruct/pdblock.cpp index 96814e70..e5bce778 100644 --- a/src/ccstruct/pdblock.cpp +++ b/src/ccstruct/pdblock.cpp @@ -16,11 +16,11 @@ * **********************************************************************/ +#include "allheaders.h" #include "pdblock.h" #include #include // std::unique_ptr -#include "allheaders.h" -#include "host.h" // for PRId32 +#include // for PRId32 // Include automatically generated configuration file if running autoconf. #ifdef HAVE_CONFIG_H diff --git a/src/ccstruct/polyblk.cpp b/src/ccstruct/polyblk.cpp index 7aacc2f7..9a89a8c0 100644 --- a/src/ccstruct/polyblk.cpp +++ b/src/ccstruct/polyblk.cpp @@ -16,12 +16,12 @@ **********************************************************************/ #include "polyblk.h" +#include "elst.h" #include +#include // PRId32 #include #include -#include // std::unique_ptr -#include "elst.h" -#include "host.h" // for PRId32 +#include // std::unique_ptr // Include automatically generated configuration file if running autoconf. #ifdef HAVE_CONFIG_H diff --git a/src/ccutil/host.h b/src/ccutil/host.h index 821292df..9ba7c3ae 100644 --- a/src/ccutil/host.h +++ b/src/ccutil/host.h @@ -25,24 +25,7 @@ #include #undef min #undef max -#endif - -#include // PRId32, ... -#include // int32_t, ... - -#if defined(_WIN32) - -/* MinGW defines the standard PRI... macros, but MSVS doesn't. */ - -#if !defined(PRId32) -#define PRId32 "d" -#endif - -#if !defined(PRId64) -#define PRId64 "I64d" -#endif - -#endif /* _WIN32 */ +#endif // _WIN32 // Return true if x is within tolerance of y template bool NearlyEqual(T x, T y, T tolerance) { diff --git a/src/dict/dawg.h b/src/dict/dawg.h index 127e73da..1960f642 100644 --- a/src/dict/dawg.h +++ b/src/dict/dawg.h @@ -29,7 +29,6 @@ #include // for PRId64 #include #include "elst.h" -#include "host.h" // for PRId64 #include "params.h" #include "ratngs.h" #include "tesscallback.h" diff --git a/src/textord/colpartition.cpp b/src/textord/colpartition.cpp index b116f73e..ec567507 100644 --- a/src/textord/colpartition.cpp +++ b/src/textord/colpartition.cpp @@ -28,6 +28,7 @@ #include "dppoint.h" #include "imagefind.h" #include "workingpartset.h" +#include "host.h" // for NearlyEqual #include diff --git a/src/textord/tabfind.cpp b/src/textord/tabfind.cpp index f34e7a90..28630bfc 100644 --- a/src/textord/tabfind.cpp +++ b/src/textord/tabfind.cpp @@ -23,9 +23,9 @@ #include "tabfind.h" #include "alignedblob.h" -#include "blobbox.h" #include "colpartitiongrid.h" #include "detlinefit.h" +#include "host.h" // for NearlyEqual #include "linefind.h" #include