Commit d7b57949 authored by Ian Lynagh's avatar Ian Lynagh

Simplify format specifiers

It turns out that we can use %zu and %llu on Win32, provided we
include PosixSource everywhere we want to use them.
parent 0ff6dbc8
......@@ -143,26 +143,10 @@ void _assertFail(const char *filename, unsigned int linenum)
#define USED_IF_NOT_THREADS
#endif
#if SIZEOF_VOID_P == 8
# define FMT_SizeT "zu"
# define FMT_HexSizeT "zx"
# define FMT_Word "zu"
# define FMT_Int "zd"
#elif SIZEOF_VOID_P == 4
# if defined(mingw32_HOST_OS)
# define FMT_SizeT "u"
# define FMT_HexSizeT "x"
# define FMT_Word "u"
# define FMT_Int "d"
# else
# define FMT_SizeT "zu"
# define FMT_HexSizeT "zx"
# define FMT_Word "zu"
# define FMT_Int "zd"
# endif
#else
# error Cannot handle this word size
#endif
#define FMT_SizeT "zu"
#define FMT_HexSizeT "zx"
#define FMT_Word "zu"
#define FMT_Int "zd"
/*
* Getting printf formats right for platform-dependent typedefs
......@@ -171,16 +155,9 @@ void _assertFail(const char *filename, unsigned int linenum)
#define FMT_Word64 "lu"
#define FMT_Int64 "ld"
#else
#if defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH)
/* mingw doesn't understand %llu/%lld - it treats them as 32-bit
rather than 64-bit */
#define FMT_Word64 "I64u"
#define FMT_Int64 "I64d"
#else
#define FMT_Word64 "llu"
#define FMT_Int64 "lld"
#endif
#endif
/* -----------------------------------------------------------------------------
Time values in the RTS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment