Fixes issue with constString in AngelScript.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
45f80444b9
commit
7c65bd084a
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue