diff options
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r-- | bfd/bfd-in2.h | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 4e1182e93d..1f0f18a7e7 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -76,8 +76,6 @@ extern "C" { /* The word size of the default bfd target. */ #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ -#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ - #include <inttypes.h> #if BFD_ARCH_SIZE >= 64 @@ -108,42 +106,34 @@ typedef struct bfd bfd; #ifdef BFD64 +/* Represent a target address. Also used as a generic unsigned type + which is guaranteed to be big enough to hold any arithmetic types + we need to deal with. */ typedef uint64_t bfd_vma; + +/* A generic signed type which is guaranteed to be big enough to hold any + arithmetic types we need to deal with. Can be assumed to be compatible + with bfd_vma in the same way that signed and unsigned ints are compatible + (as parameters, in assignment, etc). */ typedef int64_t bfd_signed_vma; + typedef uint64_t bfd_size_type; typedef uint64_t symvalue; -#if BFD_HOST_64BIT_LONG -#define BFD_VMA_FMT "l" -#elif defined (__MSVCRT__) -#define BFD_VMA_FMT "I64" -#else -#define BFD_VMA_FMT "ll" -#endif +#define BFD_VMA_FMT @BFD_INT64_FMT@ -#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 +#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x) #else /* not BFD64 */ -/* Represent a target address. Also used as a generic unsigned type - which is guaranteed to be big enough to hold any arithmetic types - we need to deal with. */ typedef unsigned long bfd_vma; - -/* A generic signed type which is guaranteed to be big enough to hold any - arithmetic types we need to deal with. Can be assumed to be compatible - with bfd_vma in the same way that signed and unsigned ints are compatible - (as parameters, in assignment, etc). */ typedef long bfd_signed_vma; - typedef unsigned long symvalue; typedef unsigned long bfd_size_type; -/* Print a bfd_vma x on stream s. */ #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) |