[SDK:WINE] Improve wine/unicode.h (v)sprintfW defines, regarding the (v)swprintf functions (#6823)

These defines assumed that the (v)swprintf functions were the
non-conformant ones (that don't take a 'count' 2nd parameter).
Because of that, use instead the _(v)swprintf functions. However,
those exist only in NT6+. Therefore, redefine these locally
using the _(v)snprintf functions.

NOTE: wine/unicode.h has been removed in wine commit
348eebae872e90a735041a153635d00b01178cfa from July 13, 2022
This commit is contained in:
Hermès Bélusca-Maïto 2023-09-27 21:13:40 +02:00
parent a69532ec4a
commit 30226f834d
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -24,6 +24,12 @@
#define WINE_UNICODE_INLINE static inline
#endif
#if (_WIN32_WINNT < _WIN32_WINNT_VISTA) || (DLL_EXPORT_VERSION < _WIN32_WINNT_VISTA)
/* msvcrt versions incompatibilities */
#define _swprintf(s,f,...) _snwprintf((s),MAXLONG,(f),##__VA_ARGS__)
#define _vswprintf(s,f,v) _vsnwprintf((s),MAXLONG,(f),(v))
#endif
#define memicmpW(s1,s2,n) _wcsnicmp((s1),(s2),(n))
#define strlenW(s) wcslen((s))
#define strcpyW(d,s) wcscpy((d),(s))
@ -55,8 +61,8 @@
#define atolW(s) _wtol((s))
#define strlwrW(s) _wcslwr((s))
#define struprW(s) _wcsupr((s))
#define sprintfW swprintf
#define vsprintfW vswprintf
#define sprintfW _swprintf
#define vsprintfW _vswprintf
#define snprintfW _snwprintf
#define vsnprintfW _vsnwprintf
#define isprintW iswprint