Realloc bufsz only if no error
[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 #  include <stdint.h>
13 #  include <stddef.h> // size_t
14 #  define PRIu64 "I64u"
15 #  define PRIX64 "I64x"
16 #  define PRIXPTR "p"
17 #  define PRIuS "Iu"
18 #else
19 # define __STDC_FORMAT_MACROS
20 # include <inttypes.h>
21 #endif
22
23 // size_t print spec
24 #ifndef PRIuS
25 # define PRIuS "zu"
26 #endif
27
28 #endif