summaryrefslogtreecommitdiff
path: root/binutils/strings.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-01-25 16:18:41 +0000
committerNick Clifton <nickc@redhat.com>2008-01-25 16:18:41 +0000
commit8b348e93225a5d642840a3452171681de2c44fae (patch)
tree7e2345e6a0508434288e63335ea61d0c5048d0f5 /binutils/strings.c
parent6b939cf2e87b82f29d1a673c3bddcfea4e9bb4ce (diff)
downloadbinutils-redhat-8b348e93225a5d642840a3452171681de2c44fae.tar.gz
Add mingw I64 support for printing long and long long values
Diffstat (limited to 'binutils/strings.c')
-rw-r--r--binutils/strings.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/binutils/strings.c b/binutils/strings.c
index c1e20770d1..650b8cbf41 100644
--- a/binutils/strings.c
+++ b/binutils/strings.c
@@ -1,6 +1,6 @@
/* strings -- print the strings of printable characters in files
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -593,7 +593,13 @@ print_strings (const char *filename, FILE *stream, file_off address,
case 8:
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
if (sizeof (start) > sizeof (long))
- printf ("%7llo ", (unsigned long long) start);
+ {
+#ifndef __MSVCRT__
+ printf ("%7llo ", (unsigned long long) start);
+#else
+ printf ("%7I64o ", (unsigned long long) start);
+#endif
+ }
else
#elif !BFD_HOST_64BIT_LONG
if (start != (unsigned long) start)
@@ -606,7 +612,13 @@ print_strings (const char *filename, FILE *stream, file_off address,
case 10:
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
if (sizeof (start) > sizeof (long))
- printf ("%7lld ", (unsigned long long) start);
+ {
+#ifndef __MSVCRT__
+ printf ("%7lld ", (unsigned long long) start);
+#else
+ printf ("%7I64d ", (unsigned long long) start);
+#endif
+ }
else
#elif !BFD_HOST_64BIT_LONG
if (start != (unsigned long) start)
@@ -619,7 +631,13 @@ print_strings (const char *filename, FILE *stream, file_off address,
case 16:
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
if (sizeof (start) > sizeof (long))
- printf ("%7llx ", (unsigned long long) start);
+ {
+#ifndef __MSVCRT__
+ printf ("%7llx ", (unsigned long long) start);
+#else
+ printf ("%7I64x ", (unsigned long long) start);
+#endif
+ }
else
#elif !BFD_HOST_64BIT_LONG
if (start != (unsigned long) start)