mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-26 09:52:31 +00:00
🐛 fix native file sink lifecycle behavior
This commit is contained in:
@@ -37,7 +37,7 @@ type NativeFileHandle
|
||||
#borrow(path, mode)
|
||||
extern "C" fn file_open_ffi(path : Bytes, mode : Bytes) -> NativeFileHandle = "fopen"
|
||||
|
||||
extern "C" fn file_is_null_ffi(handle : NativeFileHandle) -> Bool = "moonbitlang_async_pointer_is_null"
|
||||
extern "C" fn file_is_null_ffi(handle : NativeFileHandle) -> Bool = "bitlogger_pointer_is_null"
|
||||
|
||||
#borrow(buffer)
|
||||
extern "C" fn file_write_ffi(
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
}
|
||||
|
||||
options(
|
||||
"native-stub": [ "stub.c" ],
|
||||
targets: {
|
||||
"file_backend_native.mbt": [ "native", "llvm" ],
|
||||
"file_backend_stub.mbt": [ "js", "wasm", "wasm-gc" ],
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#include <stdint.h>
|
||||
|
||||
int32_t bitlogger_pointer_is_null(void *ptr) {
|
||||
return ptr == 0;
|
||||
}
|
||||
Reference in New Issue
Block a user