mirror of
https://git.code.sf.net/p/mingw-w64/mingw-w64
synced 2024-11-26 19:33:27 +08:00
headers: Fix _*tscanf and _*tprintf macros which expands to ISO C functions
Ensure that all these MS specific _*t* macros always expands to MS variant of scanf and printf functions independently of __USE_MINGW_ANSI_STDIO. Majority of the _*t* macros expands to MS specific variants of stdio functions which are not provided by mingw when __USE_MINGW_ANSI_STDIO=1. But some few are, e.g. _tscanf which currently expands to scanf or wscanf. And this can cause that _tscanf behaves differently than _tscanf_l (which does not have __USE_MINGW_ANSI_STDIO=1 replacement. Another example is %s in _stprintf() macro. MS variant of wide-printf treats %s as wchar_*t, but C95+ mandates that %s is always char*. _stprintf() is suppose to be called as: _stprintf(buffer, _T("%s"), _T("string")); And wide variant would work correctly only in the case %s takes wchar_t*. With this change behavior of all _*t* macros would be same and expands always only to MS function, which also ensures compatibility of %s with arguments passed to _*t* macros. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
8c2fb70467
commit
581532b8e4
@ -133,7 +133,7 @@ extern "C" {
|
||||
#define _tenviron _wenviron
|
||||
#define __targv __wargv
|
||||
|
||||
#define _tprintf wprintf
|
||||
#define _tprintf __ms_wprintf
|
||||
#define _tprintf_l _wprintf_l
|
||||
#define _tprintf_p _wprintf_p
|
||||
#define _tprintf_p_l _wprintf_p_l
|
||||
@ -145,7 +145,7 @@ extern "C" {
|
||||
#define _vtcprintf_l _vcwprintf_l
|
||||
#define _vtcprintf_p _vcwprintf_p
|
||||
#define _vtcprintf_p_l _vcwprintf_p_l
|
||||
#define _ftprintf fwprintf
|
||||
#define _ftprintf __ms_fwprintf
|
||||
#define _ftprintf_l _fwprintf_l
|
||||
#define _ftprintf_p _fwprintf_p
|
||||
#define _ftprintf_p_l _fwprintf_p_l
|
||||
@ -159,11 +159,11 @@ extern "C" {
|
||||
#define _sctprintf_p_l _scwprintf_p_l
|
||||
#define _sntprintf _snwprintf
|
||||
#define _sntprintf_l _snwprintf_l
|
||||
#define _vtprintf vwprintf
|
||||
#define _vtprintf __ms_vwprintf
|
||||
#define _vtprintf_l _vwprintf_l
|
||||
#define _vtprintf_p _vwprintf_p
|
||||
#define _vtprintf_p_l _vwprintf_p_l
|
||||
#define _vftprintf vfwprintf
|
||||
#define _vftprintf __ms_vfwprintf
|
||||
#define _vftprintf_l _vfwprintf_l
|
||||
#define _vftprintf_p _vfwprintf_p
|
||||
#define _vftprintf_p_l _vfwprintf_p_l
|
||||
@ -178,13 +178,13 @@ extern "C" {
|
||||
#define _vsntprintf _vsnwprintf
|
||||
#define _vsntprintf_l _vsnwprintf_l
|
||||
|
||||
#define _tscanf wscanf
|
||||
#define _tscanf __ms_wscanf
|
||||
#define _tscanf_l _wscanf_l
|
||||
#define _tcscanf _cwscanf
|
||||
#define _tcscanf_l _cwscanf_l
|
||||
#define _ftscanf fwscanf
|
||||
#define _ftscanf __ms_fwscanf
|
||||
#define _ftscanf_l _fwscanf_l
|
||||
#define _stscanf swscanf
|
||||
#define _stscanf __ms_swscanf
|
||||
#define _stscanf_l _swscanf_l
|
||||
#define _sntscanf _snwscanf
|
||||
#define _sntscanf_l _snwscanf_l
|
||||
@ -520,7 +520,7 @@ extern "C" {
|
||||
#endif
|
||||
#define __targv __argv
|
||||
|
||||
#define _tprintf printf
|
||||
#define _tprintf __ms_printf
|
||||
#define _tprintf_l _printf_l
|
||||
#define _tprintf_p _printf_p
|
||||
#define _tprintf_p_l _printf_p_l
|
||||
@ -532,11 +532,11 @@ extern "C" {
|
||||
#define _vtcprintf_l _vcprintf_l
|
||||
#define _vtcprintf_p _vcprintf_p
|
||||
#define _vtcprintf_p_l _vcprintf_p_l
|
||||
#define _ftprintf fprintf
|
||||
#define _ftprintf __ms_fprintf
|
||||
#define _ftprintf_l _fprintf_l
|
||||
#define _ftprintf_p _fprintf_p
|
||||
#define _ftprintf_p_l _fprintf_p_l
|
||||
#define _stprintf sprintf
|
||||
#define _stprintf __ms_sprintf
|
||||
#define _stprintf_l _sprintf_l
|
||||
#define _stprintf_p _sprintf_p
|
||||
#define _stprintf_p_l _sprintf_p_l
|
||||
@ -546,15 +546,15 @@ extern "C" {
|
||||
#define _sctprintf_p_l _scprintf_p_l
|
||||
#define _sntprintf _snprintf
|
||||
#define _sntprintf_l _snprintf_l
|
||||
#define _vtprintf vprintf
|
||||
#define _vtprintf __ms_vprintf
|
||||
#define _vtprintf_l _vprintf_l
|
||||
#define _vtprintf_p _vprintf_p
|
||||
#define _vtprintf_p_l _vprintf_p_l
|
||||
#define _vftprintf vfprintf
|
||||
#define _vftprintf __ms_vfprintf
|
||||
#define _vftprintf_l _vfprintf_l
|
||||
#define _vftprintf_p _vfprintf_p
|
||||
#define _vftprintf_p_l _vfprintf_p_l
|
||||
#define _vstprintf vsprintf
|
||||
#define _vstprintf __ms_vsprintf
|
||||
#define _vstprintf_l _vsprintf_l
|
||||
#define _vstprintf_p _vsprintf_p
|
||||
#define _vstprintf_p_l _vsprintf_p_l
|
||||
@ -565,13 +565,13 @@ extern "C" {
|
||||
#define _vsntprintf _vsnprintf
|
||||
#define _vsntprintf_l _vsnprintf_l
|
||||
|
||||
#define _tscanf scanf
|
||||
#define _tscanf __ms_scanf
|
||||
#define _tscanf_l _scanf_l
|
||||
#define _tcscanf _cscanf
|
||||
#define _tcscanf_l _cscanf_l
|
||||
#define _ftscanf fscanf
|
||||
#define _ftscanf __ms_fscanf
|
||||
#define _ftscanf_l _fscanf_l
|
||||
#define _stscanf sscanf
|
||||
#define _stscanf __ms_sscanf
|
||||
#define _stscanf_l _sscanf_l
|
||||
#define _sntscanf _snscanf
|
||||
#define _sntscanf_l _snscanf_l
|
||||
|
Loading…
Reference in New Issue
Block a user