Skip to content

Commit

Permalink
MSVS support inttypes.h from VS 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Apr 23, 2019
1 parent 3f9bb66 commit 27f0f2e
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/ccstruct/blobbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ccstruct/imagedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cinttypes> // for PRId64

// Number of documents to read ahead while training. Doesn't need to be very
// large.
Expand Down
4 changes: 2 additions & 2 deletions src/ccstruct/pdblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
*
**********************************************************************/

#include "allheaders.h"
#include "pdblock.h"
#include <cstdlib>
#include <memory> // std::unique_ptr
#include "allheaders.h"
#include "host.h" // for PRId32
#include <cinttypes> // for PRId32

// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
Expand Down
6 changes: 3 additions & 3 deletions src/ccstruct/polyblk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
**********************************************************************/

#include "polyblk.h"
#include "elst.h"
#include <cctype>
#include <cinttypes> // PRId32
#include <cmath>
#include <cstdio>
#include <memory> // std::unique_ptr
#include "elst.h"
#include "host.h" // for PRId32
#include <memory> // std::unique_ptr

// Include automatically generated configuration file if running autoconf.
#ifdef HAVE_CONFIG_H
Expand Down
19 changes: 1 addition & 18 deletions src/ccutil/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,7 @@
#include <windows.h>
#undef min
#undef max
#endif

#include <cinttypes> // PRId32, ...
#include <cstdint> // 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<class T> bool NearlyEqual(T x, T y, T tolerance) {
Expand Down
1 change: 0 additions & 1 deletion src/dict/dawg.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <cinttypes> // for PRId64
#include <memory>
#include "elst.h"
#include "host.h" // for PRId64
#include "params.h"
#include "ratngs.h"
#include "tesscallback.h"
Expand Down
1 change: 1 addition & 0 deletions src/textord/colpartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "dppoint.h"
#include "imagefind.h"
#include "workingpartset.h"
#include "host.h" // for NearlyEqual

#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion src/textord/tabfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm>
Expand Down

0 comments on commit 27f0f2e

Please sign in to comment.