diff --git a/vendor/Squirrel/include/squirrelex.h b/vendor/Squirrel/include/squirrelex.h index 0742cb48..b58da89b 100644 --- a/vendor/Squirrel/include/squirrelex.h +++ b/vendor/Squirrel/include/squirrelex.h @@ -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 void sq_newarrayex(HSQUIRRELVM v,SQInteger capacity); SQUIRREL_API SQInteger sq_cmpr(HSQUIRRELVM v); #ifdef __cplusplus diff --git a/vendor/Squirrel/sqapiex.cpp b/vendor/Squirrel/sqapiex.cpp index 5c194e69..e0dd4ee6 100644 --- a/vendor/Squirrel/sqapiex.cpp +++ b/vendor/Squirrel/sqapiex.cpp @@ -120,6 +120,13 @@ SQRESULT sq_arrayreserve(HSQUIRRELVM v,SQInteger idx,SQInteger newcap) return sq_throwerror(v,_SC("negative capacity")); } +void sq_newarrayex(HSQUIRRELVM v,SQInteger capacity) +{ + SQArray* a = SQArray::Create(_ss(v), 0); + a->Reserve(capacity); + v->Push(a); +} + SQInteger sq_cmpr(HSQUIRRELVM v) { SQInteger res;