Commit 29cad4a4 by Richard Kenner

(HOST_PTR_PRINTF): Handle char * wider than long.

(HOST_WIDE_INT_PRINT_{DEC,UNSIGNED,HEX,DOUBLE_HEX}): New macros.

From-SVN: r13173
parent 395d53bb
......@@ -53,7 +53,72 @@ Boston, MA 02111-1307, USA. */
/* Provide a default way to print an address in hex via printf. */
#ifndef HOST_PTR_PRINTF
#define HOST_PTR_PRINTF sizeof (int) == sizeof (char *) ? "%x" : "%lx"
#define HOST_PTR_PRINTF \
(sizeof (int) == sizeof (char *) ? "%x" \
: sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
#endif
/* Provide defaults for the way to print a HOST_WIDE_INT
in various manners. */
#ifndef HOST_WIDE_INT_PRINT_DEC
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
#define HOST_WIDE_INT_PRINT_DEC "%d"
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
#define HOST_WIDE_INT_PRINT_DEC "%ld"
#else
#define HOST_WIDE_INT_PRINT_DEC "%lld"
#endif
#endif
#endif
#ifndef HOST_WIDE_INT_PRINT_UNSIGNED
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
#define HOST_WIDE_INT_PRINT_UNSIGNED "%u"
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
#define HOST_WIDE_INT_PRINT_UNSIGNED "%lu"
#else
#define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
#endif
#endif
#endif
#ifndef HOST_WIDE_INT_PRINT_HEX
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
#define HOST_WIDE_INT_PRINT_HEX "0x%x"
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
#define HOST_WIDE_INT_PRINT_HEX "0x%lx"
#else
#define HOST_WIDE_INT_PRINT_HEX "0x%llx"
#endif
#endif
#endif
#ifndef HOST_WIDE_INT_PRINT_DOUBLE_HEX
#if HOST_BITS_PER_WIDE_INT == 64
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%016x"
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%016lx"
#else
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
#endif
#endif
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%08x"
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
#else
#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%08llx"
#endif
#endif
#endif
#endif
/* Make an enum class that gives all the machine modes. */
......
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