aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-04-05 15:27:37 +0930
committerAlan Modra <amodra@gmail.com>2021-04-05 15:27:37 +0930
commit83c79df86bf40666d1da7cd884bc10d45773df91 (patch)
tree1958fb387f15984aea41c900c959bb88c5dfb71a /bfd/bfd.c
parent5d4d26d14ca3dcf4c2d0745df720a2a5bd1bd6a5 (diff)
downloadgdb-83c79df86bf40666d1da7cd884bc10d45773df91.zip
gdb-83c79df86bf40666d1da7cd884bc10d45773df91.tar.gz
gdb-83c79df86bf40666d1da7cd884bc10d45773df91.tar.bz2
C99 bfd configury
Certain library headers and functions are required by C99. This removes configure tests for them. The patch also removes AC_ISC_POSIX and AC_HEADER_DIRENT, which the autoconf manual states are obsolescent. sys/time.h is no longer tangled up with time.h so it can be handled by the gprof configure. * configure.ac: Don't check for long long or long double type. Don't check for alloca.h, limits.h, stddef.h, stdlib.h, string.h, strings.h, time.h, wchar.h, wctype.h or sys/time.h. Don't check for strtoull, free, malloc, realloc, getenv, strstr, snprintf, vsnprintf, strlen or setitimer. Sort AC_CHECK_DECLS. (AC_ISC_POSIX): Don't invoke. (AC_HEADER_TIME, AC_HEADER_DIRENT, ACX_HEADER_STRING): Likewise. * sysdep.h: Remove many HAVE_*_H checks and fallback declarations. Do test HAVE_SYS_TYPES_H. Don't include sys/time.h. Reorder header order as per automake AC_INCLUDES_DEFAULT. * bfd-in.h: Include inttypes.h unconditionally. * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Assume long long and long double are available. (bfd_scan_vma): Assume long long and strtoull are available. * elflink.c: Include limits.h unconditionally. * elfnn-riscv.c: Likewise. * wasm-module.c: Likewise. * hpux-core.c: Include dirent.h unconditionally. * trad-core.c: Likewise. * hosts/x86-64linux.h: Include stdlib.h unconditionally. * peXXigen.c: Remove HAVE_WCHAR_H and HAVE_WCTYPE_H checks. * elf32-m68hc1x.c: Don't include alloca-conf.h. * elf64-hppa.c: Likewise. * som.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * bfd-in2.h: Regenerate. * config.in: Regenerate. * configure: Regenerate.
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r--bfd/bfd.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/bfd/bfd.c b/bfd/bfd.c
index abe5093..6e5d339 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1042,12 +1042,7 @@ _bfd_doprnt (FILE *stream, const char *format, union _bfd_doprnt_args *args)
*sptr++ = ptr[-1];
*sptr = '\0';
#endif
-#if defined (__GNUC__) || defined (HAVE_LONG_LONG)
PRINT_TYPE (long long, ll);
-#else
- /* Fake it and hope for the best. */
- PRINT_TYPE (long, l);
-#endif
break;
}
}
@@ -1062,14 +1057,7 @@ _bfd_doprnt (FILE *stream, const char *format, union _bfd_doprnt_args *args)
if (wide_width == 0)
PRINT_TYPE (double, d);
else
- {
-#if defined (__GNUC__) || defined (HAVE_LONG_DOUBLE)
- PRINT_TYPE (long double, ld);
-#else
- /* Fake it and hope for the best. */
- PRINT_TYPE (double, d);
-#endif
- }
+ PRINT_TYPE (long double, ld);
}
break;
case 's':
@@ -1271,11 +1259,7 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args)
break;
case 2:
default:
-#if defined (__GNUC__) || defined (HAVE_LONG_LONG)
arg_type = LongLong;
-#else
- arg_type = Long;
-#endif
break;
}
}
@@ -1290,13 +1274,7 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args)
if (wide_width == 0)
arg_type = Double;
else
- {
-#if defined (__GNUC__) || defined (HAVE_LONG_DOUBLE)
- arg_type = LongDouble;
-#else
- arg_type = Double;
-#endif
- }
+ arg_type = LongDouble;
}
break;
case 's':
@@ -1906,10 +1884,8 @@ bfd_scan_vma (const char *string, const char **end, int base)
if (sizeof (bfd_vma) <= sizeof (unsigned long))
return strtoul (string, (char **) end, base);
-#if defined (HAVE_STRTOULL) && defined (HAVE_LONG_LONG)
if (sizeof (bfd_vma) <= sizeof (unsigned long long))
return strtoull (string, (char **) end, base);
-#endif
if (base == 0)
{