diff --git a/Contrib/System/SConscript b/Contrib/System/SConscript index 8c842fd7..28b57e13 100644 --- a/Contrib/System/SConscript +++ b/Contrib/System/SConscript @@ -43,6 +43,8 @@ if env['TARGET_ARCH'] != 'amd64' or msvc: # BUGBUG: Call-amd64.S is missing GAS # "D4027 : source file 'file.sx' ignored" # ...and then it returns 0! # This only happens if TryCompile .S fails (ML/ML64 not in %PATH%?) + # + # BUGBUG: GCC < 4.3 does not understand .sx, only .S conf = env.Configure() if conf.TryCompile('END', '.S'): files += ['Source/'+filename+'.S'] diff --git a/Contrib/System/Source/Call.sx b/Contrib/System/Source/Call.sx index 5aabdda9..0f0a5543 100644 --- a/Contrib/System/Source/Call.sx +++ b/Contrib/System/Source/Call.sx @@ -1 +1,4 @@ +#ifdef _MSC_VER +#error "MSVC is supposed to use the plain .S file!" +#endif #include "Call.S" diff --git a/Contrib/System/Source/System.c b/Contrib/System/Source/System.c index 00796dc0..df51d254 100644 --- a/Contrib/System/Source/System.c +++ b/Contrib/System/Source/System.c @@ -31,7 +31,7 @@ #define PCD_DONE 3 // Just Continue const int PARAMSIZEBYTYPE_PTR = (4==sizeof(void*)) ? 1 : 2; -static const int ParamSizeByType[8] = { +const int ParamSizeByType[8] = { 0, // PAT_VOID (Size will be equal to 1) //BUGBUG64? 1, // PAT_INT 2, // PAT_LONG @@ -1002,10 +1002,12 @@ void ParamsIn(SystemProc *proc) par->Value = (INT_PTR) CreateCallback((SystemProc*) StrToIntPtr(realbuf)); break; case PAT_REGMEM: - (LPTSTR)place = system_getuservariableptr(par->Input - 1); - par->Value = (INT_PTR) place; - par->Value += sizeof(void*) > 4 ? sizeof(_T("-9223372036854775807")) : sizeof(_T("-2147483647")); - IntPtrToStr(par->Value, (LPTSTR)place); + { + LPTSTR straddr = system_getuservariableptr(par->Input - 1); + par->Value = (INT_PTR) straddr; + par->Value += sizeof(void*) > 4 ? sizeof(_T("-9223372036854775807")) : sizeof(_T("-2147483647")); + IntPtrToStr(par->Value, straddr); + } break; } GlobalFree(realbuf);