Win64 fixes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6405 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2013-08-07 23:04:23 +00:00
parent 7f103f9e39
commit 942ea1d465
7 changed files with 61 additions and 53 deletions

View file

@ -603,16 +603,20 @@ void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR
}
}
void NSISCALL myitoa(TCHAR *s, int d)
void NSISCALL iptrtostr(TCHAR *s, INT_PTR d)
{
#ifdef _WIN64
static const TCHAR c[] = _T("%I64d");
#else
static const TCHAR c[] = _T("%d");
#endif
wsprintf(s,c,d);
}
int NSISCALL myatoi(TCHAR *s)
INT_PTR NSISCALL strtoiptr(const TCHAR *s)
{
unsigned int v=0;
int sign=1; // sign of positive
UINT_PTR v=0;
INT_PTR sign=1; // sign of positive
TCHAR m=10; // base of 10
TCHAR t=_T('9'); // cap top of numbers at 9
@ -647,7 +651,7 @@ int NSISCALL myatoi(TCHAR *s)
v*=m;
v+=c;
}
return ((int)v)*sign;
return ((INT_PTR)v)*sign;
}
// Straight copies of selected shell functions. Calling local functions
@ -813,7 +817,7 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
else if (nVarIdx == NS_VAR_CODE)
{
if (nData == 29) // $HWNDPARENT
myitoa(out, (unsigned int) g_hwnd);
iptrtostr(out, (INT_PTR) g_hwnd);
else
mystrcpy(out, g_usrvars[nData]);
// validate the directory name