System plugin: Basic x64 fixes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6222 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2012-03-06 23:09:23 +00:00
parent adbdce4c47
commit 8aa67f8987
5 changed files with 68 additions and 54 deletions

View file

@ -3,6 +3,22 @@
#include <nsis/pluginapi.h> // nsis plugin
// Always use system* functions to keep the size down
#define pushstring error(use system_pushstring)
#define pushint error(use system_pushint)
#define popint system_popint
#define myatoi(str) ( (int) myatoi64(str) )
#ifdef _WIN64
# error TODO
#else
# define system_pushintptr system_pushint
# define popintptr popint
# define StrToIntPtr(str) ( (INT_PTR)myatoi((str)) )
#endif
#define BUGBUG64(brokencast) (brokencast) // Cast that needs fixing on x64
#define PLUGINFUNCTION(name) \
void __declspec(dllexport) name( \
HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters *extra) { \
@ -23,7 +39,7 @@ extern TCHAR *system_setuservariable(int varnum, TCHAR *var);
extern TCHAR* system_popstring(); // NULL - stack empty
extern TCHAR* system_pushstring(TCHAR *str);
extern __int64 myatoi64(TCHAR *s);
extern int popint64(); // -1 -> stack empty
extern int system_popint(); // -1 -> stack empty
extern void system_pushint(int value);
extern HANDLE GlobalCopy(HANDLE Old);