NE: Updated dmScript::LuaHBuffer constructor

A heads up for the native extension authors:
We’ve done a small cleanup of the (old) api for the dmScript::LuaHBuffer and as such, some code needs to be updated:

# from 1.2.191
dmScript::LuaHBuffer luabuffer = { buffer, true }; -> dmScript::LuaHBuffer luabuffer( buffer, dmScript::OWNER_LUA );
dmScript::LuaHBuffer luabuffer = { buffer, false }; -> dmScript::LuaHBuffer luabuffer( buffer, dmScript::OWNER_C );

EDIT1:
The new api, is already working (and released a long time ago), so once you’ve updated to it, you can continue as usual.
I confused it a bit here. The enum existed some time now, not the constructors.

The constructors are the new thing.

This change is coming in the next release, so now is a good time to update your extension if you use such buffers.

We are in the process of updating the extensions we maintain.
We also have this CI job that also builds some of the more popular external extensions, in order for us to catch these things as early as possible.

EDIT2:
My recommendation is to prepare a branch, e.g. “update-191” to have it ready for when the 191 release is out.

7 Likes

Try change. Should be “{” not “(”

dmScript::LuaHBuffer luabuffer( buffer, dmScript::OWNER_LUA );
dmScript::LuaHBuffer luabuffer{ buffer, dmScript::OWNER_LUA };
1 Like

Oh right! It’s not a constructor. It’s a struct initialiser, right? At least the constructor syntax doesn’t compile on the latest release.

1 Like

Sorry, I was confusing things a bit here.
The enum was old, not the constructors.
The constructors are the new thing that will come in 1.2.191.

1 Like