From 24e6379f5eca6427382f68657c97762b53ffd219 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Tue, 30 Apr 2019 22:28:23 +0300 Subject: [PATCH] Export newly added Squirrel functions. Fix function definition with different name than declaration. --- cbp/Module.cbp | 11 +++++++++++ cbp/default.workspace | 2 +- external/Squirrel/sqapiex.cpp | 2 +- shared/SqAPI.h | 8 ++++++++ shared/SqMod.inl | 8 +++++++- source/Misc/Exports.cpp | 2 ++ 6 files changed, 30 insertions(+), 3 deletions(-) diff --git a/cbp/Module.cbp b/cbp/Module.cbp index fbbe75eb..53b219ea 100644 --- a/cbp/Module.cbp +++ b/cbp/Module.cbp @@ -21,6 +21,7 @@ + @@ -43,6 +44,7 @@ + @@ -65,6 +67,7 @@ + @@ -88,6 +91,7 @@ + @@ -205,6 +209,7 @@ + @@ -231,6 +236,7 @@ + @@ -257,6 +263,7 @@ + @@ -284,6 +291,7 @@ + @@ -552,6 +560,8 @@ + + @@ -570,6 +580,7 @@ + diff --git a/cbp/default.workspace b/cbp/default.workspace index 317ea370..fac8d50d 100644 --- a/cbp/default.workspace +++ b/cbp/default.workspace @@ -1,8 +1,8 @@ - + diff --git a/external/Squirrel/sqapiex.cpp b/external/Squirrel/sqapiex.cpp index 07e6ec23..2862c400 100644 --- a/external/Squirrel/sqapiex.cpp +++ b/external/Squirrel/sqapiex.cpp @@ -36,7 +36,7 @@ begin: return SQ_ERROR; } -void sqstd_pushstringf(HSQUIRRELVM v,const SQChar *s,...) +void sq_pushstringf(HSQUIRRELVM v,const SQChar *s,...) { SQInteger n=256; va_list args; diff --git a/shared/SqAPI.h b/shared/SqAPI.h index 0039b30e..08838552 100644 --- a/shared/SqAPI.h +++ b/shared/SqAPI.h @@ -84,6 +84,7 @@ extern "C" { typedef SQRESULT (*SqLibAPI_setclosureroot)(HSQUIRRELVM v,SQInteger idx); typedef SQRESULT (*SqLibAPI_getclosureroot)(HSQUIRRELVM v,SQInteger idx); typedef void (*SqLibAPI_pushstring)(HSQUIRRELVM v,const SQChar *s,SQInteger len); + typedef void (*SqLibAPI_pushstringf)(HSQUIRRELVM v,const SQChar *s,...); typedef void (*SqLibAPI_pushfloat)(HSQUIRRELVM v,SQFloat f); typedef void (*SqLibAPI_pushinteger)(HSQUIRRELVM v,SQInteger n); typedef void (*SqLibAPI_pushbool)(HSQUIRRELVM v,SQBool b); @@ -167,6 +168,7 @@ extern "C" { typedef const SQChar* (*SqLibAPI_getfreevariable)(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval); typedef const SQChar* (*SqLibAPI_getonefreevariable)(HSQUIRRELVM v,SQUnsignedInteger nval); typedef SQRESULT (*SqLibAPI_throwerror)(HSQUIRRELVM v,const SQChar *err); + typedef SQRESULT (*SqLibAPI_throwerrorf)(HSQUIRRELVM v,const SQChar *err,...); typedef SQRESULT (*SqLibAPI_throwobject)(HSQUIRRELVM v); typedef void (*SqLibAPI_reseterror)(HSQUIRRELVM v); typedef void (*SqLibAPI_getlasterror)(HSQUIRRELVM v); @@ -275,6 +277,7 @@ extern "C" { SqLibAPI_setclosureroot setclosureroot; SqLibAPI_getclosureroot getclosureroot; SqLibAPI_pushstring pushstring; + SqLibAPI_pushstringf pushstringf; SqLibAPI_pushfloat pushfloat; SqLibAPI_pushinteger pushinteger; SqLibAPI_pushbool pushbool; @@ -358,6 +361,7 @@ extern "C" { SqLibAPI_getfreevariable getfreevariable; SqLibAPI_getonefreevariable getonefreevariable; SqLibAPI_throwerror throwerror; + SqLibAPI_throwerrorf throwerrorf; SqLibAPI_throwobject throwobject; SqLibAPI_reseterror reseterror; SqLibAPI_getlasterror getlasterror; @@ -462,6 +466,7 @@ extern "C" { extern SqLibAPI_setclosureroot SqLib_setclosureroot; extern SqLibAPI_getclosureroot SqLib_getclosureroot; extern SqLibAPI_pushstring SqLib_pushstring; + extern SqLibAPI_pushstringf SqLib_pushstringf; extern SqLibAPI_pushfloat SqLib_pushfloat; extern SqLibAPI_pushinteger SqLib_pushinteger; extern SqLibAPI_pushbool SqLib_pushbool; @@ -545,6 +550,7 @@ extern "C" { extern SqLibAPI_getfreevariable SqLib_getfreevariable; extern SqLibAPI_getonefreevariable SqLib_getonefreevariable; extern SqLibAPI_throwerror SqLib_throwerror; + extern SqLibAPI_throwerrorf SqLib_throwerrorf; extern SqLibAPI_throwobject SqLib_throwobject; extern SqLibAPI_reseterror SqLib_reseterror; extern SqLibAPI_getlasterror SqLib_getlasterror; @@ -645,6 +651,7 @@ extern "C" { #define sq_setclosureroot SqLib_setclosureroot #define sq_getclosureroot SqLib_getclosureroot #define sq_pushstring SqLib_pushstring + #define sq_pushstringf SqLib_pushstringf #define sq_pushfloat SqLib_pushfloat #define sq_pushinteger SqLib_pushinteger #define sq_pushbool SqLib_pushbool @@ -728,6 +735,7 @@ extern "C" { #define sq_getfreevariable SqLib_getfreevariable #define sq_getonefreevariable SqLib_getonefreevariable #define sq_throwerror SqLib_throwerror + #define sq_throwerrorf SqLib_throwerrorf #define sq_throwobject SqLib_throwobject #define sq_reseterror SqLib_reseterror #define sq_getlasterror SqLib_getlasterror diff --git a/shared/SqMod.inl b/shared/SqMod.inl index b529185c..532305b1 100644 --- a/shared/SqMod.inl +++ b/shared/SqMod.inl @@ -262,6 +262,7 @@ SqLibAPI_bindenv SqLib_bindenv SqLibAPI_setclosureroot SqLib_setclosureroot = NULL; SqLibAPI_getclosureroot SqLib_getclosureroot = NULL; SqLibAPI_pushstring SqLib_pushstring = NULL; +SqLibAPI_pushstringf SqLib_pushstringf = NULL; SqLibAPI_pushfloat SqLib_pushfloat = NULL; SqLibAPI_pushinteger SqLib_pushinteger = NULL; SqLibAPI_pushbool SqLib_pushbool = NULL; @@ -343,8 +344,9 @@ SqLibAPI_resume SqLib_resume SqLibAPI_getlocal SqLib_getlocal = NULL; SqLibAPI_getcallee SqLib_getcallee = NULL; SqLibAPI_getfreevariable SqLib_getfreevariable = NULL; -SqLibAPI_getonefreevariable SqLib_getonefreevariable = NULL; +SqLibAPI_getonefreevariable SqLib_getonefreevariable = NULL; SqLibAPI_throwerror SqLib_throwerror = NULL; +SqLibAPI_throwerrorf SqLib_throwerrorf = NULL; SqLibAPI_throwobject SqLib_throwobject = NULL; SqLibAPI_reseterror SqLib_reseterror = NULL; SqLibAPI_getlasterror SqLib_getlasterror = NULL; @@ -456,6 +458,7 @@ uint8_t sqlib_api_expand(HSQLIBAPI sqlibapi) SqLib_setclosureroot = sqlibapi->setclosureroot; SqLib_getclosureroot = sqlibapi->getclosureroot; SqLib_pushstring = sqlibapi->pushstring; + SqLib_pushstringf = sqlibapi->pushstringf; SqLib_pushfloat = sqlibapi->pushfloat; SqLib_pushinteger = sqlibapi->pushinteger; SqLib_pushbool = sqlibapi->pushbool; @@ -539,6 +542,7 @@ uint8_t sqlib_api_expand(HSQLIBAPI sqlibapi) SqLib_getfreevariable = sqlibapi->getfreevariable; SqLib_getonefreevariable = sqlibapi->getonefreevariable; SqLib_throwerror = sqlibapi->throwerror; + SqLib_throwerrorf = sqlibapi->throwerrorf; SqLib_throwobject = sqlibapi->throwobject; SqLib_reseterror = sqlibapi->reseterror; SqLib_getlasterror = sqlibapi->getlasterror; @@ -649,6 +653,7 @@ void sqlib_api_collapse() SqLib_setclosureroot = NULL; SqLib_getclosureroot = NULL; SqLib_pushstring = NULL; + SqLib_pushstringf = NULL; SqLib_pushfloat = NULL; SqLib_pushinteger = NULL; SqLib_pushbool = NULL; @@ -732,6 +737,7 @@ void sqlib_api_collapse() SqLib_getfreevariable = NULL; SqLib_getonefreevariable = NULL; SqLib_throwerror = NULL; + SqLib_throwerrorf = NULL; SqLib_throwobject = NULL; SqLib_reseterror = NULL; SqLib_getlasterror = NULL; diff --git a/source/Misc/Exports.cpp b/source/Misc/Exports.cpp index 01c0f099..3ca6a0b1 100644 --- a/source/Misc/Exports.cpp +++ b/source/Misc/Exports.cpp @@ -771,6 +771,7 @@ static int32_t SqExport_PopulateSquirrelAPI(HSQLIBAPI api, size_t size) api->setclosureroot = sq_setclosureroot; api->getclosureroot = sq_getclosureroot; api->pushstring = sq_pushstring; + api->pushstringf = sq_pushstringf; api->pushfloat = sq_pushfloat; api->pushinteger = sq_pushinteger; api->pushbool = sq_pushbool; @@ -854,6 +855,7 @@ static int32_t SqExport_PopulateSquirrelAPI(HSQLIBAPI api, size_t size) api->getfreevariable = sq_getfreevariable; api->getonefreevariable = sq_getonefreevariable; api->throwerror = sq_throwerror; + api->throwerrorf = sq_throwerrorf; api->throwobject = sq_throwobject; api->reseterror = sq_reseterror; api->getlasterror = sq_getlasterror;