aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd-in.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/bfd-in.h')
-rw-r--r--bfd/bfd-in.h45
1 files changed, 19 insertions, 26 deletions
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 482e88d..37df5f2 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -55,6 +55,8 @@ extern "C" {
#if @BFD_HOST_64_BIT_DEFINED@
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
+typedef BFD_HOST_64_BIT bfd_int64_t;
+typedef BFD_HOST_U_64_BIT bfd_uint64_t;
#endif
#if BFD_ARCH_SIZE >= 64
@@ -95,24 +97,6 @@ typedef int bfd_boolean;
#define true dont_use_true_in_bfd
#endif
-/* Support for different sizes of target format ints and addresses.
- If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
- set to 1 above. Otherwise, if the host compiler used during
- configuration supports long long, this code will use it.
- Otherwise, BFD_HOST_64_BIT must be defined above. */
-
-#ifndef BFD_HOST_64_BIT
-# if BFD_HOST_64BIT_LONG
-# define BFD_HOST_64_BIT long
-# define BFD_HOST_U_64_BIT unsigned long
-# else
-# if BFD_HOST_LONG_LONG
-# define BFD_HOST_64_BIT long long
-# define BFD_HOST_U_64_BIT unsigned long long
-# endif /* ! BFD_HOST_LONG_LONG */
-# endif /* ! BFD_HOST_64BIT_LONG */
-#endif /* ! defined (BFD_HOST_64_BIT) */
-
#ifdef BFD64
#ifndef BFD_HOST_64_BIT
@@ -160,6 +144,15 @@ typedef unsigned long bfd_size_type;
#endif /* not BFD64 */
+#ifndef BFD_HOST_64_BIT
+/* Fall back on a 32 bit type. The idea is to make these types always
+ available for function return types, but in the case that
+ BFD_HOST_64_BIT is undefined such a function should abort or
+ otherwise signal an error. */
+typedef bfd_signed_vma bfd_int64_t;
+typedef bfd_vma bfd_uint64_t;
+#endif
+
/* An offset into a file. BFD always uses the largest possible offset
based on the build time availability of fseek, fseeko, or fseeko64. */
typedef @bfd_file_ptr@ file_ptr;
@@ -518,10 +511,10 @@ extern bfd_boolean bfd_record_phdr
/* Byte swapping routines. */
-bfd_vma bfd_getb64 (const void *);
-bfd_vma bfd_getl64 (const void *);
-bfd_signed_vma bfd_getb_signed_64 (const void *);
-bfd_signed_vma bfd_getl_signed_64 (const void *);
+bfd_uint64_t bfd_getb64 (const void *);
+bfd_uint64_t bfd_getl64 (const void *);
+bfd_int64_t bfd_getb_signed_64 (const void *);
+bfd_int64_t bfd_getl_signed_64 (const void *);
bfd_vma bfd_getb32 (const void *);
bfd_vma bfd_getl32 (const void *);
bfd_signed_vma bfd_getb_signed_32 (const void *);
@@ -530,8 +523,8 @@ bfd_vma bfd_getb16 (const void *);
bfd_vma bfd_getl16 (const void *);
bfd_signed_vma bfd_getb_signed_16 (const void *);
bfd_signed_vma bfd_getl_signed_16 (const void *);
-void bfd_putb64 (bfd_vma, void *);
-void bfd_putl64 (bfd_vma, void *);
+void bfd_putb64 (bfd_uint64_t, void *);
+void bfd_putl64 (bfd_uint64_t, void *);
void bfd_putb32 (bfd_vma, void *);
void bfd_putl32 (bfd_vma, void *);
void bfd_putb16 (bfd_vma, void *);
@@ -539,8 +532,8 @@ void bfd_putl16 (bfd_vma, void *);
/* Byte swapping routines which take size and endiannes as arguments. */
-bfd_vma bfd_get_bits (const void *, int, bfd_boolean);
-void bfd_put_bits (bfd_vma, void *, int, bfd_boolean);
+bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
+void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
/* Externally visible ECOFF routines. */