From 4997292d4bf3af02c91af68a0f6eeba87fd9e730 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 25 Dec 2013 04:50:54 +0000 Subject: [PATCH] build fixes for vc git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6421 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/Platform.h | 4 ++-- Source/util.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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