When winegcc is using an underlying POSIX libc (rather than -mno-cygwin) it will only have `char` and `wchar_t` functions. If _TCHAR is neither of these there may be no suitable function to alias _tcs* to.
Signed-off-by: Kevin Puetz PuetzKevinA@JohnDeere.com --- include/tchar.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/tchar.h b/include/tchar.h index 56f876bf84..33db74c7ee 100644 --- a/include/tchar.h +++ b/include/tchar.h @@ -37,9 +37,15 @@ extern "C" { #define _strninc(str,n) (((char*)(str))+(n)) #define _strspnp(s1,s2) (*((s1)+=strspn((s1),(s2))) ? (s1) : NULL)
+#if defined(__MSVCRT__) || defined(_MSC_VER) || (defined(WINE_UNICODE_NATIVE) && defined(_UNICODE)) || !(defined(_UNICODE) || defined(_MBCS))
/***************************************************************************** * tchar mappings + * + * These can only be defined when libc in use will have functions accepting _TCHAR, i.e. + * -mno-cygwin / __MSVCRT__ or __MSC_VER + * -fshort-wchar / WINE_UNICODE_NATIVE and _UNICODE (_TCHAR == WCHAR == wchar_t, so the libc wcs* functions are UTF-16) + * _TCHAR == `char` without _MBCS */ #ifndef _UNICODE # ifndef _MBCS @@ -223,6 +229,8 @@ extern "C" { #define _vtprintf WINE_tchar_routine(vprintf, vprintf, vwprintf) #define _TEOF WINE_tchar_routine(EOF, EOF, WEOF)
+#endif /* tchar mappings */ + #define __T(x) __TEXT(x) #define _T(x) __T(x) #define _TEXT(x) __T(x)
Sorry, apparently git quiltimport cuts at the --- too, so the motive I intended to explain on the submission (but not the git commit message) got left out.
---
wine-5.2 (c12089039637dec5e598ed1c41e707f057494242) changed to allow <tchar.h> to be used without MSVCRT. This is useful for _TEXT(...) and _TCHAR typedefs, but the _tcs* macros may still be unusable
Omitting them will be a clearer compile error when to not exist than mapping them to e.g. wcs* functions which do not actually accept a windows WCHAR (because WCHAR != wchar_t)