[svn-r4813] Purpose:

Bug fix
Description:
    HDfprintf was not handling Microsoft's "%I64d" extension to printf for
    printing thier '__int64' type.
Solution:
    Added code to properly detect and use this extension.
Platforms tested:
    None!  (Kent will be testing shortly)
This commit is contained in:
Quincey Koziol 2002-01-11 10:41:48 -05:00
parent c5d5a551c9
commit aabfa5c03f

View File

@ -797,7 +797,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
}
/* Type modifier */
if (HDstrchr ("ZHhlqL", *s)) {
if (HDstrchr ("ZHhlqLI", *s)) {
switch (*s) {
case 'H':
if (sizeof(hsize_t)<sizeof(long)) {
@ -818,16 +818,26 @@ HDfprintf (FILE *stream, const char *fmt, ...)
}
break;
default:
/* Handle 'll' for long long types */
if(*s=='l' && *(s+1)=='l') {
/* Handle 'I64' modifier for Microsoft's "__int64" type */
if(*s=='I' && *(s+1)=='6' && *(s+2)=='4') {
modifier[0] = *s;
modifier[1] = *s;
modifier[2] = '\0';
s++; /* Increment over first 'l', second is taken care of below */
modifier[1] = *(s+1);
modifier[2] = *(s+2);
modifier[3] = '\0';
s+=2; /* Increment over 'I6', the '4' is taken care of below */
} /* end if */
else {
modifier[0] = *s;
modifier[1] = '\0';
/* Handle 'll' for long long types */
if(*s=='l' && *(s+1)=='l') {
modifier[0] = *s;
modifier[1] = *s;
modifier[2] = '\0';
s++; /* Increment over first 'l', second is taken care of below */
} /* end if */
else {
modifier[0] = *s;
modifier[1] = '\0';
} /* end else */
} /* end else */
break;
}