VC6 unicode fixes, NSISException still broken

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6082 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2010-05-04 22:28:53 +00:00
parent 5a5a3a674f
commit b8f6c16fcd
4 changed files with 31 additions and 3 deletions

View file

@ -22,6 +22,7 @@
#include <cstdlib>
#include <cstring>
#include "tstring.h"
#include "util.h"
LineParser::LineParser(bool bCommentBlock)
{

View file

@ -22,8 +22,13 @@
#define _T(x) __T(x)
#define _TEXT(x) __T(x)
#endif
#if defined(_MSC_VER) && (_MSC_VER<=1200)
typedef unsigned short TCHAR;
typedef unsigned short _TUCHAR;
#else
typedef wchar_t TCHAR;
typedef wchar_t _TUCHAR;
#endif
// program
#define _tmain wmain
@ -34,11 +39,19 @@ typedef wchar_t _TUCHAR;
// printfs
#define _ftprintf fwprintf
#define _sntprintf _snwprintf
#define _stprintf _swprintf
#if defined(_MSC_VER) && (_MSC_VER<=1200)
# define _stprintf swprintf
#else
# define _stprintf _swprintf
#endif
#define _tprintf wprintf
#define _vftprintf vfwprintf
#define _vsntprintf _vsnwprintf
#define _vstprintf _vswprintf
#if defined(_MSC_VER) && (_MSC_VER<=1200)
# define _vstprintf vswprintf
#else
# define _vstprintf _vswprintf
#endif
// scanfs
#define _tscanf wscanf
@ -74,7 +87,11 @@ typedef wchar_t _TUCHAR;
#define _tcstoi64 _wcstoi64
#define _tcstol wcstol
#define _tcstoul wcstoul
#define _tstof _wtof
#if defined(_MSC_VER) && (_MSC_VER<=1200)
# define _tstof my_wtof
#else
# define _tstof _wtof
#endif
#define _tstoi _wtoi
#define _tstoi64 _wtoi64
#define _ttoi _wtoi

View file

@ -65,6 +65,14 @@ void dopause(void)
}
}
double my_wtof(const wchar_t *str)
{
char buf[100];
WideCharToMultiByte(0,0,str,-1,buf,100,0,0);
return atof(buf);
}
// Returns 0 if everything is OK
// Returns -1 if can't find the file
// Returns -2 if the file is an invalid bitmap

View file

@ -34,6 +34,8 @@
extern int g_dopause;
extern void dopause(void);
extern double my_wtof(const wchar_t *str);
// Adds the bitmap in filename using resource editor re as id id.
// If width or height are specified it will also make sure the bitmap is in that size
int update_bitmap(CResourceEditor* re, WORD id, const TCHAR* filename, int width=0, int height=0, int maxbpp=0);