Commit 97557ae1 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Enable printf %z, %t and %j formats.

parent 1309e11e
......@@ -515,16 +515,18 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API
break;
} else if(*p == 'w')
flags.WideString = *p++;
#if _MSVCR_VER >= 140
else if(*p == 'z' || *p == 't')
#if _MSVCR_VER == 0 || _MSVCR_VER >= 140
else if((*p == 'z' || *p == 't') && p[1] && strchr("diouxX", p[1]))
flags.IntegerNative = *p++;
else if(*p == 'T')
flags.NaturalString = *p++;
else if(*p == 'j') {
flags.IntegerDouble++;
p++;
}
#endif
#if _MSVCR_VER >= 140
else if(*p == 'T')
flags.NaturalString = *p++;
#endif
else if((*p == 'F' || *p == 'N') && legacy_msvcrt_compat)
p++; /* ignore */
else
......
......@@ -163,8 +163,10 @@ static void test_sprintf( void )
{ "%Ihd", "Ihd", 0, INT_ARG, 1 },
{ "%I0d", "I0d", 0, INT_ARG, 1 },
{ "%I64D", "D", 0, ULONGLONG_ARG, 0, -1 },
{ "%zx", "1", "zx", TODO_FLAG | INT_ARG, 1 },
{ "%z", "1", "z", TODO_FLAG | INT_ARG, 1 },
{ "%zx", "1", "zx", INT_ARG, 1 },
{ "%z", "z", 0, INT_ARG, 1 },
{ "%tx", "1", "tx", INT_ARG, 1 },
{ "%t", "t", 0, INT_ARG, 1 },
{ "% d", " 1", 0, INT_ARG, 1 },
{ "%+ d", "+1", 0, INT_ARG, 1 },
{ "%S", "wide", 0, PTR_ARG, 0, 0, 0, L"wide" },
......@@ -216,9 +218,8 @@ static void test_sprintf( void )
{ "%u", "4294967295", 0, INT_ARG, -1 },
{ "%w", "", 0, INT_ARG, -1 },
{ "%h", "", 0, INT_ARG, -1 },
{ "%z", "z", 0, INT_ARG, -1 },
{ "%j", "", "j", TODO_FLAG | ULONGLONG_ARG, 0, -1 },
{ "%jd", "-1", "jd", TODO_FLAG | ULONGLONG_ARG, 0, -1 },
{ "%j", "", "j", ULONGLONG_ARG, 0, -1 },
{ "%jd", "-1", "jd", ULONGLONG_ARG, 0, -1 },
{ "%F", "", 0, INT_ARG, -1 },
{ "%N", "", 0, INT_ARG, -1 },
{ "%H", "H", 0, INT_ARG, -1 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment