1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 15:17:13 +02:00

Fix assertion functions.

This commit is contained in:
Sandu Liviu Catalin
2021-02-03 21:59:48 +02:00
parent fc0751c6da
commit 70a5eaa5d1
3 changed files with 75 additions and 56 deletions

View File

@ -16,6 +16,7 @@ SQUIRREL_API SQRESULT sq_pushstringf(HSQUIRRELVM v,const SQChar *s,...);
SQUIRREL_API SQRESULT sq_vpushstringf(HSQUIRRELVM v,const SQChar *s,va_list l);
SQUIRREL_API SQRESULT sq_getnativeclosurepointer(HSQUIRRELVM v,SQInteger idx,SQFUNCTION *f);
SQUIRREL_API SQRESULT sq_arrayreserve(HSQUIRRELVM v,SQInteger idx,SQInteger newcap);
SQUIRREL_API SQInteger sq_cmpr(HSQUIRRELVM v);
#ifdef __cplusplus
} /*extern "C"*/

View File

@ -119,3 +119,10 @@ SQRESULT sq_arrayreserve(HSQUIRRELVM v,SQInteger idx,SQInteger newcap)
}
return sq_throwerror(v,_SC("negative capacity"));
}
SQInteger sq_cmpr(HSQUIRRELVM v)
{
SQInteger res;
v->ObjCmp(stack_get(v, -2), stack_get(v, -1),res);
return res;
}