From 7010d9f6e16070ffa5b703a91d212f6fbfaed609 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Mon, 13 Jul 2020 08:20:21 +0100 Subject: [PATCH] Remove WCHAR not needed and change TCHAR to a define. This helps QTCreator to show the string in the debugger. Otherwise it would show just an array of bytes. Signed-off-by: Andrea Odetti --- source/linux/windows/wincompat.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/source/linux/windows/wincompat.h b/source/linux/windows/wincompat.h index 918ea1dd..c4e8b908 100644 --- a/source/linux/windows/wincompat.h +++ b/source/linux/windows/wincompat.h @@ -148,15 +148,6 @@ typedef LONG_PTR LRESULT; typedef DWORD LCID, *PLCID; -typedef char WCHAR; // wc, 16-bit UNICODE character -typedef WCHAR *PWCHAR; -typedef WCHAR *LPWCH, *PWCH; -typedef CONST WCHAR *LPCWCH, *PCWCH; -typedef WCHAR *NWPSTR; -typedef WCHAR *LPWSTR, *PWSTR; - -typedef CONST WCHAR *LPCWSTR, *PCWSTR; - typedef unsigned __int64 UINT64, *PUINT64; // @@ -170,14 +161,19 @@ typedef CHAR *NPSTR; typedef CHAR *LPSTR, *PSTR; typedef CONST CHAR *LPCSTR, *PCSTR; -typedef LPWSTR LPTCH, PTCH; -typedef LPWSTR PTSTR, LPTSTR; -typedef LPCWSTR LPCTSTR; -typedef LPWSTR LP; +typedef LPSTR LPTCH, PTCH; +typedef LPSTR PTSTR, LPTSTR; +typedef LPCSTR LPCTSTR; +typedef LPSTR LP; #ifndef _TCHAR_DEFINED -typedef char TCHAR, _TCHAR, *PTCHAR; +// TCHAR a typedef or a define? +// a define for the single reason that +// othwerise QTCreator does not show the values (i.e. string) while debugging +// it treats it as an array of bytes +#define TCHAR char +typedef TCHAR _TCHAR, *PTCHAR; typedef unsigned char TBYTE , *PTBYTE ; #define _TCHAR_DEFINED #endif /* !_TCHAR_DEFINED */