Fixes issue with constString in AngelScript.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-07-04 19:17:45 +02:00
parent 45f80444b9
commit 7c65bd084a
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ static void ConstructConstString(void* self) { new (self) ArbUt::StringView(); }
static void ConstructConstStringFromStd(void* self, const std::string& s) { static void ConstructConstStringFromStd(void* self, const std::string& s) {
new (self) ArbUt::StringView(s.c_str(), s.length()); new (self) ArbUt::StringView(s.c_str(), s.length());
} }
static void CopyConstructConstString(const ArbUt::StringView& other, void* self) { static void CopyConstructConstString(void* self, const ArbUt::StringView& other) {
new (self) ArbUt::StringView(other); new (self) ArbUt::StringView(other);
} }
static void DestructConstString(void* self) { ((ArbUt::StringView*)self)->~StringView(); } static void DestructConstString(void* self) { ((ArbUt::StringView*)self)->~StringView(); }
@ -19,18 +19,18 @@ void ConstStringRegister::Register(asIScriptEngine* engine) {
Assert(r >= 0); Assert(r >= 0);
r = engine->RegisterObjectBehaviour("constString", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructConstString), r = engine->RegisterObjectBehaviour("constString", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructConstString),
asCALL_CDECL_OBJLAST); asCALL_CDECL_OBJFIRST);
Assert(r >= 0); Assert(r >= 0);
r = engine->RegisterObjectBehaviour("constString", asBEHAVE_CONSTRUCT, "void f(const string &in s)", r = engine->RegisterObjectBehaviour("constString", asBEHAVE_CONSTRUCT, "void f(const string &in s)",
asFUNCTION(ConstructConstStringFromStd), asCALL_CDECL_OBJLAST); asFUNCTION(ConstructConstStringFromStd), asCALL_CDECL_OBJFIRST);
Assert(r >= 0); Assert(r >= 0);
r = engine->RegisterObjectBehaviour("constString", asBEHAVE_CONSTRUCT, "void f(const constString &in)", r = engine->RegisterObjectBehaviour("constString", asBEHAVE_CONSTRUCT, "void f(const constString &in)",
asFUNCTION(CopyConstructConstString), asCALL_CDECL_OBJLAST); asFUNCTION(CopyConstructConstString), asCALL_CDECL_OBJFIRST);
Assert(r >= 0); Assert(r >= 0);
r = engine->RegisterObjectBehaviour("constString", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(DestructConstString), r = engine->RegisterObjectBehaviour("constString", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(DestructConstString),
asCALL_CDECL_OBJLAST); asCALL_CDECL_OBJFIRST);
Assert(r >= 0); Assert(r >= 0);
r = engine->RegisterObjectMethod( r = engine->RegisterObjectMethod(