This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Use strtoull for bfd_scan_vma
- From: Ian Lance Taylor <ian at airs dot com>
- To: binutils at sourceware dot org
- Date: 27 Aug 2003 10:58:47 -0700
- Subject: Use strtoull for bfd_scan_vma
The new C standard adds the function strtoull(), like strtoul() but
returning unsigned long long. I checked in this patch to use it in
bfd_scan_vma() when it is available.
Diffs to generated files omitted.
Ian
2003-08-27 Ian Lance Taylor <ian@airs.com>
* configure.in: Check for strtoull.
* bfd.c (bfd_scan_vma): Use strtoull when available.
* configure, config.in: Regenerate.
Index: bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.51
diff -u -p -r1.51 bfd.c
--- bfd.c 29 Jun 2003 10:06:39 -0000 1.51
+++ bfd.c 27 Aug 2003 17:56:17 -0000
@@ -920,6 +920,11 @@ bfd_scan_vma (const char *string, const
if (sizeof (bfd_vma) <= sizeof (unsigned long))
return strtoul (string, (char **) end, base);
+#ifdef HAVE_STRTOULL
+ if (sizeof (bfd_vma) <= sizeof (unsigned long long))
+ return strtoull (string, (char **) end, base);
+#endif
+
if (base == 0)
{
if (string[0] == '0')
Index: configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.135
diff -u -p -r1.135 configure.in
--- configure.in 27 Aug 2003 17:43:39 -0000 1.135
+++ configure.in 27 Aug 2003 17:56:20 -0000
@@ -148,6 +148,7 @@ AC_CHECK_HEADERS(fcntl.h sys/file.h sys/
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
+AC_CHECK_FUNCS(strtoull)
BFD_BINARY_FOPEN