(svn r9448) [NoAI] -Codechange: extend the squirrel_export script to update ai_squirrel too.
#include <squirrel.h>
#include "stdafx.h"
#include "squirrel.hpp"
#include "squirrel_std.hpp"
#include "helpers.hpp"
/* abs() is normally defined to myabs(), which we don't want in this file */
#undef abs
SQInteger SquirrelStd::abs(HSQUIRRELVM vm)
{
SQInteger tmp;
sq_getinteger(vm, 2, &tmp);
sq_pushinteger(vm, myabs(tmp));
return 1;
}
void squirrel_register_std(Squirrel *engine)
{
/* We don't use squirrel_helper here, as we want to register to the global
* scope and not to a class. */
engine->AddMethod("abs", &SquirrelStd::abs, 2, "xi");
}