diff options
author | Alan Modra <amodra@gmail.com> | 2008-07-28 04:07:32 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2008-07-28 04:07:32 +0000 |
commit | 14a9197011818108c904f8c8eb5fbba48f3cfd7d (patch) | |
tree | 9365cef928ad49a13356580e77cd41d1c619d94f /bfd/bfd-in2.h | |
parent | 17bdf94d94144206c30bf035c70025231c906439 (diff) | |
download | gdb-14a9197011818108c904f8c8eb5fbba48f3cfd7d.zip gdb-14a9197011818108c904f8c8eb5fbba48f3cfd7d.tar.gz gdb-14a9197011818108c904f8c8eb5fbba48f3cfd7d.tar.bz2 |
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-in2.h')
-rw-r--r-- | bfd/bfd-in2.h | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 087eff8..f8e34ac 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -135,26 +135,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 */ @@ -174,8 +165,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 */ |