summaryrefslogtreecommitdiff
path: root/bfd/bfd-in.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-07-28 04:07:32 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-07-28 04:07:32 +0000
commit7e0cfb2c2458c743e900c023b6de94c77ad12529 (patch)
tree8c972831346a82314bdf858e71ee6996c181473a /bfd/bfd-in.h
parent395e8207696526193fb68cb9ecc11f5bee21ddd5 (diff)
downloadbinutils-redhat-7e0cfb2c2458c743e900c023b6de94c77ad12529.tar.gz
bfd/
PR 6769 * bfd-in.h (BFD_VMA_FMT): Define. (printf_vma, sprintf_vma): Use the above. (_bfd_int64_low, _bfd_int64_high): Delete. * bfd-in2.h: Regenerate. binutils/ PR 6769 * readelf.c (print_dec_vma, print_hex_vma): Delete. (print_vma): Use BFD_VMA_FMT. * size.c (size_number, rprint_number): Likewise.
Diffstat (limited to 'bfd/bfd-in.h')
-rw-r--r--bfd/bfd-in.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 21f4f4c788..827cc1a683 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -128,26 +128,17 @@ typedef BFD_HOST_64_BIT bfd_signed_vma;
typedef BFD_HOST_U_64_BIT bfd_size_type;
typedef BFD_HOST_U_64_BIT symvalue;
-#ifndef fprintf_vma
#if BFD_HOST_64BIT_LONG
-#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
-#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
-#elif BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
-#define sprintf_vma(s,x) sprintf (s, "%016llx", x)
-#define fprintf_vma(f,x) fprintf (f, "%016llx", x)
-#else
-#define sprintf_vma(s,x) sprintf (s, "%016I64x", x)
-#define fprintf_vma(f,x) fprintf (f, "%016I64x", x)
-#endif
+#define BFD_VMA_FMT "l"
+#elif defined (__MSVCRT__)
+#define BFD_VMA_FMT "I64"
#else
-#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
-#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
-#define fprintf_vma(s,x) \
- fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
-#define sprintf_vma(s,x) \
- sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
+#define BFD_VMA_FMT "ll"
#endif
+
+#ifndef fprintf_vma
+#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
+#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
#endif
#else /* not BFD64 */
@@ -167,8 +158,9 @@ typedef unsigned long symvalue;
typedef unsigned long bfd_size_type;
/* Print a bfd_vma x on stream s. */
-#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
-#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
+#define BFD_VMA_FMT "l"
+#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
+#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
#endif /* not BFD64 */