Version 3.0.23.01.25
[clinfo] / src / fmtmacros.h
1 /* cl_ulong is always a 64bit integer, so in a few places
2    we want to use its shadow type uint64_t, and print the
3    values using PRIu64. We'll similarly define one for
4    size_t, to make support for non-standard/older compiler
5    easier.
6  */
7
8 #ifndef FMT_MACROS_H
9 #define FMT_MACROS_H
10
11 #ifdef _WIN32
12 /* TODO FIXME WIN64 support */
13 # include <stdint.h>
14 # include <stddef.h> // size_t
15 # define PRIu32 "I32u"
16 # define PRId32 "I32d"
17 # define PRIx32 "I32x"
18 # define PRIX32 "I32X"
19 # define PRIu64 "I64u"
20 # define PRIx64 "I64x"
21 # define PRIX64 "I64X"
22 # define PRIuS "Iu"
23 #if INTPTR_MAX <= INT32_MAX
24 # define PRIXPTR PRIX32
25 # define PRIxPTR PRIx32
26 #else
27 # define PRIXPTR PRIX64
28 # define PRIxPTR PRIx64
29 #endif
30 #else
31 # define __STDC_FORMAT_MACROS
32 # include <inttypes.h>
33 #endif
34
35 // size_t print spec
36 #ifndef PRIuS
37 # define PRIuS "zu"
38 #endif
39
40 #endif