@@ -68,15 +68,15 @@ private abstract IntBool(Int) from Int to Int {
6868}
6969
7070private class Misc {
71- public static function writer (L : State , p : cpp. ConstStar <cpp. Void >, sz : cpp. SizeT , ud : cpp. Star <cpp. Void >): Int {
71+ public static function writer (L : cpp. RawPointer < NativeState > , p : cpp. RawConstPointer <cpp. Void >, sz : cpp. SizeT , ud : cpp. Star <cpp. Void >): Int {
7272 var func : (State , haxe.io. Bytes ) -> Int = cast ud ;
73- return func (L ,haxe.io. Bytes .ofData (cpp. Pointer .fromStar ( cast p ).toUnmanagedArray (sz )));
73+ return func (cpp. Pointer . fromRaw ( L ) ,haxe.io. Bytes .ofData (cpp. Pointer .fromRaw (( cast p : cpp. RawPointer < cpp. UInt8 >) ).toUnmanagedArray (sz )));
7474 }
7575
76- public static function reader (L : State ,ud : cpp. Star <cpp. Void >,sz : cpp. Star <cpp. SizeT >): cpp. ConstCharStar {
76+ public static function reader (L : cpp. RawPointer < NativeState > ,ud : cpp. Star <cpp. Void >,sz : cpp. RawPointer <cpp. SizeT >): cpp. ConstCharStar {
7777 var func : (State )-> haxe.io. Bytes = cast ud ;
78- var b = func (L );
79- untyped __cpp__ ( " *sz = {0} " , b .length ) ;
78+ var b = func (cpp. Pointer . fromRaw ( L ) );
79+ sz [ 0 ] = b .length ;
8080 return cast cpp. Pointer .ofArray (b .getData ()).constRaw ;
8181
8282 }
@@ -273,7 +273,7 @@ extern class Lua {
273273 static function cpcall <T : Dynamic >(L : State , func : LuaCFunction , ud : T ): Int ;
274274 #if cpp
275275 @:native (" lua_load" )
276- private static function _load (L : State , reader : cpp. Callable <(State ,cpp. Star <cpp. Void >,cpp. Star <cpp. SizeT >)-> cpp. ConstCharStar >, dt : cpp. Star <cpp. Void >, chunkname : CString ): Int ;
276+ private static function _load (L : State , reader : cpp. Callable <(cpp. RawPointer < NativeState > ,cpp. Star <cpp. Void >,cpp. RawPointer <cpp. SizeT >)-> cpp. ConstCharStar >, dt : cpp. Star <cpp. Void >, chunkname : CString ): Int ;
277277 static inline function load (L : State ,reader : (State )-> haxe.io. Bytes ,chunkname : String ): Int {
278278 return _load (L ,cpp. Callable .fromStaticFunction (Misc .reader ),cast reader ,chunkname );
279279 }
@@ -283,9 +283,10 @@ extern class Lua {
283283 #end
284284 #if cpp
285285 @:native (" lua_dump" )
286- private static function _dump (L : State ,writer : cpp. Callable <(State ,cpp. ConstStar <cpp. Void >,cpp. SizeT ,cpp. Star <cpp. Void >)-> Int >,ud : cpp. Star <cpp. Void >): Int ;
286+ private static function _dump (L : State ,
287+ writer : cpp. Callable <(cpp. RawPointer <NativeState >,cpp. RawConstPointer <cpp. Void >,cpp. SizeT ,cpp. Star <cpp. Void >)-> Int >,ud : cpp. Star <cpp. Void >): Int ;
287288 static inline function dump (L : State ,writer : (State ,haxe.io. Bytes )-> Int ): Int {
288- return _dump (L ,cpp. Callable .fromStaticFunction (Misc .writer ),cast writer );
289+ return _dump (L ,cpp. Function .fromStaticFunction (Misc .writer ),cast writer );
289290 }
290291 #elseif hl
291292 @:skipHL
0 commit comments