Cleanup output format warnings (#904)
Use `PRIxxx` related macros to format the output strings so as to clear compile warnings, e.g. PRIu32, PRId32, PRIX32, PRIX64 and so on. And add the related macro definitions in platform_common.h if they are not defined, as some compilers might not support them.
This commit is contained in:
@ -104,6 +104,48 @@ typedef int64_t int64;
|
||||
|
||||
typedef void *(*thread_start_routine_t)(void *);
|
||||
|
||||
#ifndef PRId32
|
||||
#define PRId32 "d"
|
||||
#endif
|
||||
#ifndef PRIi32
|
||||
#define PRIi32 "i"
|
||||
#endif
|
||||
#ifndef PRIu32
|
||||
#define PRIu32 "u"
|
||||
#endif
|
||||
#ifndef PRIx32
|
||||
#define PRIx32 "x"
|
||||
#endif
|
||||
#ifndef PRIX32
|
||||
#define PRIX32 "X"
|
||||
#endif
|
||||
|
||||
#ifndef __PRI64_PREFIX
|
||||
#if UINTPTR_MAX == UINT64_MAX
|
||||
#define __PRI64_PREFIX "l"
|
||||
#define __PRIPTR_PREFIX "l"
|
||||
#else
|
||||
#define __PRI64_PREFIX "ll"
|
||||
#define __PRIPTR_PREFIX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PRId64
|
||||
#define PRId64 __PRI64_PREFIX "d"
|
||||
#endif
|
||||
#ifndef PRIu64
|
||||
#define PRIu64 __PRI64_PREFIX "u"
|
||||
#endif
|
||||
#ifndef PRIx64
|
||||
#define PRIx64 __PRI64_PREFIX "x"
|
||||
#endif
|
||||
#ifndef PRIX64
|
||||
#define PRIX64 __PRI64_PREFIX "X"
|
||||
#endif
|
||||
#ifndef PRIXPTR
|
||||
#define PRIXPTR __PRIPTR_PREFIX "X"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user