diff --git a/Source/Platform.h b/Source/Platform.h index 77bb364e..13a32ee3 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -22,8 +22,8 @@ // some definitions for non Win32 platforms were taken from MinGW's free Win32 library -#if defined(__cplusplus) && defined(MAKENSIS) -template class NSISCHARTYPE{ T _c; public: NSISCHARTYPE(){} NSISCHARTYPE(T c):_c(c){} operator T()const{ return _c; } }; +#if defined(__cplusplus) && defined(MAKENSIS) && !defined(_MSC_VER) +template class NSISCHARTYPE{ T _c; public: NSISCHARTYPE(){} NSISCHARTYPE(T c):_c(c){} operator T()const{ return _c; } operator int()const{ return (int) _c; } operator bool()const{ return _c != 0; } }; typedef NSISCHARTYPE WINWCHAR; // WINWCHAR is always UTF16LE and should not be passed to wcs* functions #else typedef unsigned short WINWCHAR; diff --git a/Source/util.h b/Source/util.h index d62a6c21..7c134bfd 100644 --- a/Source/util.h +++ b/Source/util.h @@ -99,7 +99,9 @@ bool WINAPI WinStdIO_OStreamWrite(WINSIO_OSDATA&osd, const wchar_t *Str, UINT cc int WINAPI WinStdIO_vfwprintf(FILE*strm, const wchar_t*Fmt, va_list val); int WinStdIO_fwprintf(FILE*strm, const wchar_t*Fmt, ...); int WinStdIO_wprintf(const wchar_t*Fmt, ...); +#ifndef _MSC_VER // our tchar.h already defined everything... #include // Make sure we include the CRTs tchar.h in case it is pulled in by something else later. +#endif // We don't hook fflush since the native handle is only used with WriteConsoleW #undef _vsntprintf #define _vsntprintf Error: TODO