ptr += 2;
}
+ /* There is a clash between Microsoft's non-standard I64
+ and I32 integer length modifiers and glibc's
+ non-standard I flag. */
+ const char *printf_flag_chars
+ = sizeof PRId64 == sizeof "I64d" ? "-+ #0'" : "-+ #0'I";
+
/* Move past flags. */
- while (strchr ("-+ #0'I", *ptr))
+ while (strchr (printf_flag_chars, *ptr))
*sptr++ = *ptr++;
if (*ptr == '*')
while (ISDIGIT (*ptr))
*sptr++ = *ptr++;
}
+ if (sizeof PRId64 == sizeof "I64d" && *ptr =='I')
+ {
+ if (ptr[1] == '6' && ptr[2] == '4')
+ {
+ wide_width = 3;
+ *sptr++ = *ptr++;
+ *sptr++ = *ptr++;
+ *sptr++ = *ptr++;
+ }
+ else if (ptr[1] == '3' && ptr[2] == '2')
+ {
+ *sptr++ = *ptr++;
+ *sptr++ = *ptr++;
+ *sptr++ = *ptr++;
+ }
+ }
while (strchr ("hlL", *ptr))
{
switch (*ptr)
PRINT_TYPE (long, l);
break;
case 2:
+ if (sizeof PRId64 == sizeof "I64d")
+ {
+ /* Convert any %ll to %I64. */
+ sptr[-3] = 'I';
+ sptr[-2] = '6';
+ sptr[-1] = '4';
+ *sptr++ = ptr[-1];
+ *sptr = '\0';
+ }
+ /* Fall through. */
default:
-#if defined (__MSVCRT__)
- sptr[-3] = 'I';
- sptr[-2] = '6';
- sptr[-1] = '4';
- *sptr++ = ptr[-1];
- *sptr = '\0';
-#endif
PRINT_TYPE (long long, ll);
break;
}
ptr += 2;
}
+ /* There is a clash between Microsoft's non-standard I64
+ and I32 integer length modifiers and glibc's
+ non-standard I flag. */
+ const char *printf_flag_chars
+ = sizeof PRId64 == sizeof "I64d" ? "-+ #0'" : "-+ #0'I";
+
/* Move past flags. */
- while (strchr ("-+ #0'I", *ptr))
+ while (strchr (printf_flag_chars, *ptr))
ptr++;
if (*ptr == '*')
while (ISDIGIT (*ptr))
ptr++;
}
+
+ if (sizeof PRId64 == sizeof "I64d" && *ptr =='I')
+ {
+ if (ptr[1] == '6' && ptr[2] == '4')
+ {
+ wide_width = 3;
+ ptr += 3;
+ }
+ else if (ptr[1] == '3' && ptr[2] == '2')
+ ptr += 3;
+ }
while (strchr ("hlL", *ptr))
{
switch (*ptr)