aboutsummaryrefslogtreecommitdiff
path: root/binutils/strings.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-04-05 15:30:22 +0930
committerAlan Modra <amodra@gmail.com>2021-04-05 15:30:22 +0930
commit87b9f2556d5f47328f3ac59088e9be0759959ebb (patch)
treeec6646d13ad2269930deb9a49418dee23600d567 /binutils/strings.c
parentab2af25e83abb7da1619e8ae678b9286d5448d67 (diff)
downloadfsf-binutils-gdb-87b9f2556d5f47328f3ac59088e9be0759959ebb.zip
fsf-binutils-gdb-87b9f2556d5f47328f3ac59088e9be0759959ebb.tar.gz
fsf-binutils-gdb-87b9f2556d5f47328f3ac59088e9be0759959ebb.tar.bz2
C99 binutils configury
* configure.ac: Assume long long is available. Don't test for strings.h, stdlib.h, limits.h, locale.h, or wchar.h. Check inttypes.h, stdint.h, sys/stat.h and sys/types.h. Don't check for strcoll, setlocale, setmode or location of time_t. Don't check for fprintf, getenv, snprintf, strnlen, strstr or vsnprintf decls. (AC_ISC_POSIX, AXC_HEADER_STRING, AC_FUNC_ALLOCA): Don't invoke. * sysdep.h: Don't include alloca-conf.h, include config.h instead. Test HAVE_SYS_TYPES_H and reorder includes. Include limits.h, locale.h, string.h and stdlib.h unconditionally. Remove various fallback declarations. Assume long long is available. * addr2line.c: Don't test HAVE_SETLOCALE. * ar.c: Likewise. * coffdump.c: Likewise. * dlltool.c: Likewise. * dllwrap.c: Likewise. * elfedit.c: Likewise. * nm.c: Likewise. * objcopy.c: Likewise. * objdump.c: Likewise. * readelf.c: Likewise. * size.c: Likewise. * srconv.c: Likewise. * strings.c: Likewise. * sysdump.c: Likewise. * windmc.c: Likewise. * windres.c: Likewise. * bucomm.c: Don't test HAVE_TIME_T_IN_TIME_H or HAVE_TIME_T_IN_TYPES_H. * dwarf.c: Include limits.h unconditionally. Assume long long is available. * nm.c: Don't test HAVE_STRCOLL. * readelf.c: Don't test HAVE_WCHAR_H. * strings.c: Assume long long is available. * syslex.l: Include string.h unconditionally. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate.
Diffstat (limited to 'binutils/strings.c')
-rw-r--r--binutils/strings.c45
1 files changed, 12 insertions, 33 deletions
diff --git a/binutils/strings.c b/binutils/strings.c
index 3ecdb92..44a8e1d 100644
--- a/binutils/strings.c
+++ b/binutils/strings.c
@@ -149,9 +149,7 @@ main (int argc, char **argv)
char *s;
int numeric_opt = 0;
-#if defined (HAVE_SETLOCALE)
setlocale (LC_ALL, "");
-#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
@@ -610,61 +608,42 @@ print_strings (const char *filename, FILE *stream, file_ptr address,
switch (address_radix)
{
case 8:
-#ifdef HAVE_LONG_LONG
if (sizeof (start) > sizeof (long))
{
-# ifndef __MSVCRT__
+#ifndef __MSVCRT__
printf ("%7llo ", (unsigned long long) start);
-# else
+#else
printf ("%7I64o ", (unsigned long long) start);
-# endif
+#endif
}
else
-#elif !BFD_HOST_64BIT_LONG
- if (start != (unsigned long) start)
- printf ("++%7lo ", (unsigned long) start);
- else
-#endif
- printf ("%7lo ", (unsigned long) start);
+ printf ("%7lo ", (unsigned long) start);
break;
case 10:
-#ifdef HAVE_LONG_LONG
if (sizeof (start) > sizeof (long))
{
-# ifndef __MSVCRT__
+#ifndef __MSVCRT__
printf ("%7llu ", (unsigned long long) start);
-# else
+#else
printf ("%7I64d ", (unsigned long long) start);
-# endif
+#endif
}
else
-#elif !BFD_HOST_64BIT_LONG
- if (start != (unsigned long) start)
- printf ("++%7lu ", (unsigned long) start);
- else
-#endif
- printf ("%7ld ", (long) start);
+ printf ("%7ld ", (long) start);
break;
case 16:
-#ifdef HAVE_LONG_LONG
if (sizeof (start) > sizeof (long))
{
-# ifndef __MSVCRT__
+#ifndef __MSVCRT__
printf ("%7llx ", (unsigned long long) start);
-# else
+#else
printf ("%7I64x ", (unsigned long long) start);
-# endif
+#endif
}
else
-#elif !BFD_HOST_64BIT_LONG
- if (start != (unsigned long) start)
- printf ("%lx%8.8lx ", (unsigned long) (start >> 32),
- (unsigned long) (start & 0xffffffff));
- else
-#endif
- printf ("%7lx ", (unsigned long) start);
+ printf ("%7lx ", (unsigned long) start);
break;
}