Syntax '*ptr = Structure.init' requires opAssign operator, get rid of this requirement by using malloc.
This is useful when component is defined in another shared library and we use '-fvisibility=hidden', in that case opAssign is hidden and we will get 'undefined symbol'
This commit is contained in:
parent
a8d48f1218
commit
c0246ce2af
1 changed files with 2 additions and 1 deletions
|
|
@ -1307,7 +1307,8 @@ export struct EntityManager
|
|||
info.size = Comp.sizeof;
|
||||
info.alignment = Comp.alignof; //8;
|
||||
info.init_data = Mallocator.makeArray!ubyte(Comp.sizeof);
|
||||
*cast(Comp*) info.init_data.ptr = Comp.init; // = Comp();
|
||||
__gshared Comp init_memory;
|
||||
memcpy(info.init_data.ptr, &init_memory, Comp.sizeof);
|
||||
|
||||
ushort comp_id = components_map.get(cast(char[]) ComponentName, ushort.max);
|
||||
if (comp_id < components.length)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue