Made most libraries panic on js targets instead of not compiling

This commit is contained in:
Dragos Popescu
2023-03-20 04:08:48 +01:00
parent fe533fb809
commit adac039a2b
7 changed files with 569 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
//+build !js
package wasm_js_interface
import "core:mem"
PAGE_SIZE :: 64 * 1024
page_alloc :: proc(page_count: int) -> (data: []byte, err: mem.Allocator_Error) {
panic("vendor:wasm/js not supported on non-js targets")
}
page_allocator :: proc() -> mem.Allocator {
panic("vendor:wasm/js not supported on non-js targets")
}