2006-10-11 Andrew Stubbs * printcmd.c (printf_command): Convert %lld to %I64d on MinGW. Index: src/gdb/printcmd.c =================================================================== --- src.orig/gdb/printcmd.c 2006-07-17 23:15:55.000000000 +0100 +++ src/gdb/printcmd.c 2006-10-11 11:28:29.000000000 +0100 @@ -1967,8 +1967,24 @@ printf_command (char *arg, int from_tty) *f); f++; - strncpy (current_substring, last_arg, f - last_arg); - current_substring += f - last_arg; +#if defined (__MINGW32__) + /* Windows' printf does support long long, but not the usual way. + Convert %lld to %I64d. */ + if (lcount > 1) + { + int length_before_ll = f - last_arg - 1 - lcount; + strncpy (current_substring, last_arg, length_before_ll); + strcpy (current_substring + length_before_ll, "I64"); + current_substring[length_before_ll + 3] = + last_arg[length_before_ll + lcount]; + current_substring += length_before_ll + 4; + } + else +#endif + { + strncpy (current_substring, last_arg, f - last_arg); + current_substring += f - last_arg; + } *current_substring++ = '\0'; last_arg = f; argclass[nargs_wanted++] = this_argclass; @@ -2056,7 +2072,8 @@ printf_command (char *arg, int from_tty) error (_("long double not supported in printf")); #endif case long_long_arg: -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) +#if defined (CC_HAS_LONG_LONG) && (defined (PRINTF_HAS_LONG_LONG) \ + || defined (__MINGW32__)) { long long val = value_as_long (val_args[i]); printf_filtered (current_substring, val);