fix compilation for new os package

This commit is contained in:
2026-05-13 19:58:15 +02:00
parent e17be59712
commit c85faf16b4
2 changed files with 6 additions and 8 deletions
+3 -3
View File
@@ -1,17 +1,17 @@
package main package main
import "core:fmt" import "core:fmt"
import "core:os/os2" import "core:os"
import tinyvg "../" import tinyvg "../"
main :: proc() { main :: proc() {
if len(os2.args) < 2 { if len(os.args) < 2 {
fmt.println("Provide a path to a tvg file") fmt.println("Provide a path to a tvg file")
return return
} }
tvg, err := tinyvg.load_from_file(os2.args[1]) tvg, err := tinyvg.load_from_file(os.args[1])
if err != nil { if err != nil {
fmt.println(err) fmt.println(err)
} }
+3 -5
View File
@@ -1,11 +1,9 @@
package tinyvg package tinyvg
import "core:os/os2" import "core:os"
import "core:fmt" import "core:fmt"
import "core:io" import "core:io"
import "core:slice"
import "core:bytes" import "core:bytes"
import "core:debug/trace"
import "base:runtime" import "base:runtime"
@@ -252,11 +250,11 @@ TvgError :: enum {
Error :: union { Error :: union {
TvgError, TvgError,
io.Error, io.Error,
os2.Error, os.Error,
} }
load_from_file :: proc(filename: string, allocator := context.allocator) -> (tvg: ^Tvg, err: Error) { load_from_file :: proc(filename: string, allocator := context.allocator) -> (tvg: ^Tvg, err: Error) {
data := os2.read_entire_file(filename, allocator) or_return data := os.read_entire_file(filename, allocator) or_return
defer delete(data, allocator) defer delete(data, allocator)
return load_from_bytes(data, allocator) return load_from_bytes(data, allocator)