Skip to content

Commit 27f0f2e

Browse files
committed
MSVS support inttypes.h from VS 2015
1 parent 3f9bb66 commit 27f0f2e

File tree

8 files changed

+9
-27
lines changed

8 files changed

+9
-27
lines changed

src/ccstruct/blobbox.h

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "elst.h" // for ELIST_ITERATOR, ELISTIZEH, ELIST_LINK
2626
#include "elst2.h" // for ELIST2_ITERATOR, ELIST2IZEH, ELIST2_LINK
2727
#include "errcode.h" // for ASSERT_HOST
28-
#include "host.h" // for PRId32
2928
#include "ocrblock.h" // for BLOCK
3029
#include "params.h" // for DoubleParam, double_VAR_H
3130
#include "pdblock.h" // for PDBLK

src/ccstruct/imagedata.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
#include "boxread.h" // for ReadMemBoxes
3434
#include "callcpp.h" // for window_wait
3535
#include "helpers.h" // for IntCastRounded, TRand, ClipToRange, Modulo
36-
#include "host.h" // for PRId64
3736
#include "rect.h" // for TBOX
3837
#include "scrollview.h" // for ScrollView, ScrollView::CYAN, ScrollView::NONE
3938
#include "serialis.h" // for TFile
4039
#include "tprintf.h" // for tprintf
40+
#include <cinttypes> // for PRId64
4141

4242
// Number of documents to read ahead while training. Doesn't need to be very
4343
// large.

src/ccstruct/pdblock.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
*
1717
**********************************************************************/
1818

19+
#include "allheaders.h"
1920
#include "pdblock.h"
2021
#include <cstdlib>
2122
#include <memory> // std::unique_ptr
22-
#include "allheaders.h"
23-
#include "host.h" // for PRId32
23+
#include <cinttypes> // for PRId32
2424

2525
// Include automatically generated configuration file if running autoconf.
2626
#ifdef HAVE_CONFIG_H

src/ccstruct/polyblk.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
**********************************************************************/
1717

1818
#include "polyblk.h"
19+
#include "elst.h"
1920
#include <cctype>
21+
#include <cinttypes> // PRId32
2022
#include <cmath>
2123
#include <cstdio>
22-
#include <memory> // std::unique_ptr
23-
#include "elst.h"
24-
#include "host.h" // for PRId32
24+
#include <memory> // std::unique_ptr
2525

2626
// Include automatically generated configuration file if running autoconf.
2727
#ifdef HAVE_CONFIG_H

src/ccutil/host.h

+1-18
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,7 @@
2525
#include <windows.h>
2626
#undef min
2727
#undef max
28-
#endif
29-
30-
#include <cinttypes> // PRId32, ...
31-
#include <cstdint> // int32_t, ...
32-
33-
#if defined(_WIN32)
34-
35-
/* MinGW defines the standard PRI... macros, but MSVS doesn't. */
36-
37-
#if !defined(PRId32)
38-
#define PRId32 "d"
39-
#endif
40-
41-
#if !defined(PRId64)
42-
#define PRId64 "I64d"
43-
#endif
44-
45-
#endif /* _WIN32 */
28+
#endif // _WIN32
4629

4730
// Return true if x is within tolerance of y
4831
template<class T> bool NearlyEqual(T x, T y, T tolerance) {

src/dict/dawg.h

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <cinttypes> // for PRId64
3030
#include <memory>
3131
#include "elst.h"
32-
#include "host.h" // for PRId64
3332
#include "params.h"
3433
#include "ratngs.h"
3534
#include "tesscallback.h"

src/textord/colpartition.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "dppoint.h"
2929
#include "imagefind.h"
3030
#include "workingpartset.h"
31+
#include "host.h" // for NearlyEqual
3132

3233
#include <algorithm>
3334

src/textord/tabfind.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
#include "tabfind.h"
2525
#include "alignedblob.h"
26-
#include "blobbox.h"
2726
#include "colpartitiongrid.h"
2827
#include "detlinefit.h"
28+
#include "host.h" // for NearlyEqual
2929
#include "linefind.h"
3030

3131
#include <algorithm>

0 commit comments

Comments
 (0)