Skip to content

Commit 9d0ecfb

Browse files
Fix bytes abstraction.
1 parent c86548c commit 9d0ecfb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Lua.hx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ private abstract CString(cpp.ConstCharStar) from cpp.ConstCharStar to cpp.ConstC
4747

4848
private typedef Ref<T> = cpp.Star<T>;
4949

50-
private abstract Bytes(cpp.Star<Void>) {
51-
@:from static function fromBytes(b:haxe.io.Bytes) {
52-
return cast @:privateAccess b.b;
50+
private abstract Bytes(cpp.RawPointer<Void>) {
51+
@:from static function fromBytes(b:haxe.io.Bytes) {
52+
return cpp.Pointer.ofArray(b.b).rawCast();
5353
}
5454
}
5555

@@ -84,8 +84,6 @@ private class Misc {
8484
#else
8585
#error "Unsupported platform"
8686
#end
87-
// private typedef Reader = cpp.Callable<(state:State, size:Ref<Int>) -> Bytes>;
88-
// private typedef Writer = cpp.Callable<(state:State, data:Bytes, size:Int) -> Int>;
8987
typedef LuaCFunction = Callable<State->Int>;
9088

9189
enum abstract LuaType(Int) {

0 commit comments

Comments
 (0)