Automatic date update in version.in
[binutils-gdb.git] / gprof / gmon_io.c
index c613809d3961e15c31aaf1ea3296860d1e32b8c1..2b4dd26375bf7232c7b83da91c7a9f0ae6bf2689 100644 (file)
@@ -48,10 +48,8 @@ enum gmon_ptr_signedness {
 static enum gmon_ptr_size gmon_get_ptr_size (void);
 static enum gmon_ptr_signedness gmon_get_ptr_signedness (void);
 
-#ifdef BFD_HOST_U_64_BIT
-static int gmon_io_read_64 (FILE *, BFD_HOST_U_64_BIT *);
-static int gmon_io_write_64 (FILE *, BFD_HOST_U_64_BIT);
-#endif
+static int gmon_io_read_64 (FILE *, uint64_t *);
+static int gmon_io_write_64 (FILE *, uint64_t);
 static int gmon_read_raw_arc
   (FILE *, bfd_vma *, bfd_vma *, unsigned long *);
 static int gmon_write_raw_arc
@@ -109,9 +107,8 @@ gmon_io_read_32 (FILE *ifp, unsigned int *valp)
   return 0;
 }
 
-#ifdef BFD_HOST_U_64_BIT
 static int
-gmon_io_read_64 (FILE *ifp, BFD_HOST_U_64_BIT *valp)
+gmon_io_read_64 (FILE *ifp, uint64_t *valp)
 {
   char buf[8];
 
@@ -120,15 +117,12 @@ gmon_io_read_64 (FILE *ifp, BFD_HOST_U_64_BIT *valp)
   *valp = bfd_get_64 (core_bfd, buf);
   return 0;
 }
-#endif
 
 int
 gmon_io_read_vma (FILE *ifp, bfd_vma *valp)
 {
   unsigned int val32;
-#ifdef BFD_HOST_U_64_BIT
-  BFD_HOST_U_64_BIT val64;
-#endif
+  uint64_t val64;
 
   switch (gmon_get_ptr_size ())
     {
@@ -136,23 +130,19 @@ gmon_io_read_vma (FILE *ifp, bfd_vma *valp)
       if (gmon_io_read_32 (ifp, &val32))
        return 1;
       if (gmon_get_ptr_signedness () == ptr_signed)
-        *valp = (int) val32;
+       *valp = (int) val32;
       else
-        *valp = val32;
+       *valp = val32;
       break;
 
-#ifdef BFD_HOST_U_64_BIT
     case ptr_64bit:
       if (gmon_io_read_64 (ifp, &val64))
        return 1;
-#ifdef BFD_HOST_64_BIT
       if (gmon_get_ptr_signedness () == ptr_signed)
-        *valp = (BFD_HOST_64_BIT) val64;
+       *valp = (int64_t) val64;
       else
-#endif
-        *valp = val64;
+       *valp = val64;
       break;
-#endif
     }
   return 0;
 }
@@ -176,9 +166,8 @@ gmon_io_write_32 (FILE *ofp, unsigned int val)
   return 0;
 }
 
-#ifdef BFD_HOST_U_64_BIT
 static int
-gmon_io_write_64 (FILE *ofp, BFD_HOST_U_64_BIT val)
+gmon_io_write_64 (FILE *ofp, uint64_t val)
 {
   char buf[8];
 
@@ -187,7 +176,6 @@ gmon_io_write_64 (FILE *ofp, BFD_HOST_U_64_BIT val)
     return 1;
   return 0;
 }
-#endif
 
 int
 gmon_io_write_vma (FILE *ofp, bfd_vma val)
@@ -200,12 +188,10 @@ gmon_io_write_vma (FILE *ofp, bfd_vma val)
        return 1;
       break;
 
-#ifdef BFD_HOST_U_64_BIT
     case ptr_64bit:
-      if (gmon_io_write_64 (ofp, (BFD_HOST_U_64_BIT) val))
+      if (gmon_io_write_64 (ofp, (uint64_t) val))
        return 1;
       break;
-#endif
     }
   return 0;
 }
@@ -232,9 +218,7 @@ gmon_io_write (FILE *ofp, char *buf, size_t n)
 static int
 gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *spc, unsigned long *cnt)
 {
-#ifdef BFD_HOST_U_64_BIT
-  BFD_HOST_U_64_BIT cnt64;
-#endif
+  uint64_t cnt64;
   unsigned int cnt32;
 
   if (gmon_io_read_vma (ifp, fpc)
@@ -249,13 +233,11 @@ gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *spc, unsigned long *cnt)
       *cnt = cnt32;
       break;
 
-#ifdef BFD_HOST_U_64_BIT
     case ptr_64bit:
       if (gmon_io_read_64 (ifp, &cnt64))
        return 1;
       *cnt = cnt64;
       break;
-#endif
 
     default:
       return 1;
@@ -278,12 +260,10 @@ gmon_write_raw_arc (FILE *ofp, bfd_vma fpc, bfd_vma spc, unsigned long cnt)
        return 1;
       break;
 
-#ifdef BFD_HOST_U_64_BIT
     case ptr_64bit:
-      if (gmon_io_write_64 (ofp, (BFD_HOST_U_64_BIT) cnt))
+      if (gmon_io_write_64 (ofp, (uint64_t) cnt))
        return 1;
       break;
-#endif
     }
   return 0;
 }