7 #define SINGLE_ARG_FUNC(_funcname) static SQInteger math_##_funcname(HSQUIRRELVM v){ \ 10 sq_pushfloat(v,(SQFloat)_funcname(f)); \ 14 #define TWO_ARGS_FUNC(_funcname) static SQInteger math_##_funcname(HSQUIRRELVM v){ \ 16 sq_getfloat(v,2,&p1); \ 17 sq_getfloat(v,3,&p2); \ 18 sq_pushfloat(v,(SQFloat)_funcname(p1,p2)); \ 27 srand((
unsigned int)i);
61 #define _DECL_FUNC(name,nparams,tycheck) {_SC(#name),math_##name,nparams,tycheck} 85 #define M_PI (3.14159265358979323846) #define _DECL_FUNC(name, nparams, tycheck)
SQRESULT sq_throwerror(HSQUIRRELVM v, const SQChar *err)
#define TWO_ARGS_FUNC(_funcname)
void sq_pushfloat(HSQUIRRELVM v, SQFloat n)
#define SINGLE_ARG_FUNC(_funcname)
SQRESULT sq_getinteger(HSQUIRRELVM v, SQInteger idx, SQInteger *i)
void sq_pushinteger(HSQUIRRELVM v, SQInteger n)
void sq_newclosure(HSQUIRRELVM v, SQFUNCTION func, SQUnsignedInteger nfreevars)
SQRESULT sq_setnativeclosurename(HSQUIRRELVM v, SQInteger idx, const SQChar *name)
SQRESULT sqstd_register_mathlib(HSQUIRRELVM v)
SQRESULT sq_setparamscheck(HSQUIRRELVM v, SQInteger nparamscheck, const SQChar *typemask)
void sq_pushstring(HSQUIRRELVM v, const SQChar *s, SQInteger len)
static SQInteger math_abs(HSQUIRRELVM v)
static SQInteger math_srand(HSQUIRRELVM v)
static SQInteger math_rand(HSQUIRRELVM v)
static SQRegFunction mathlib_funcs[]