Add format characters for (s)size_t and ptrdiff_t
This commit is contained in:
parent
ac4e7f6269
commit
3b3d999618
1 changed files with 11 additions and 0 deletions
11
src/util.h
11
src/util.h
|
@ -54,6 +54,17 @@ static const int64 CENT = 1000000;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Format characters for (s)size_t and ptrdiff_t */
|
||||||
|
#if defined(_MSC_VER) || defined(__MSVCRT__)
|
||||||
|
#define PRIszx "%Ix"
|
||||||
|
#define PRIszu "%Iu"
|
||||||
|
#define PRIszd "%Id"
|
||||||
|
#else
|
||||||
|
#define PRIszx "%zx"
|
||||||
|
#define PRIszu "%zu"
|
||||||
|
#define PRIszd "%zd"
|
||||||
|
#endif
|
||||||
|
|
||||||
// This is needed because the foreach macro can't get over the comma in pair<t1, t2>
|
// This is needed because the foreach macro can't get over the comma in pair<t1, t2>
|
||||||
#define PAIRTYPE(t1, t2) std::pair<t1, t2>
|
#define PAIRTYPE(t1, t2) std::pair<t1, t2>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue