Fix up ABI name for core:os and core:os/old

This commit is contained in:
Jeroen van Rijn
2026-02-09 16:27:53 +01:00
parent e7dbabf668
commit 8366e7094a
106 changed files with 117 additions and 128 deletions

View File

@@ -258,7 +258,7 @@ parse_and_set_pointer_by_named_type :: proc(ptr: rawptr, str: string, data_type:
// NOTE(Feoramund): os.Error is system-dependent, and there's
// currently no good way to translate them all into strings.
//
// The upcoming `os2` package will hopefully solve this.
// The upcoming `core:os` package will hopefully solve this.
//
// We can at least provide the number for now, so the user can look
// it up.

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"
import "core:slice"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:intrinsics"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "core:sys/linux"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "core:sys/posix"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "core:sys/darwin"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "core:container/queue"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "core:slice"
import "base:intrinsics"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"
import "core:time"

View File

@@ -1,6 +1,6 @@
// Package os provides a platform-independent interface to operating system functionality.
// package os_old provides a platform-independent interface to operating system functionality.
// The design is UNIX-like but with Odin-like error handling. Failing calls return values with a specific error type rather than error number.
//
// The package os interface is intended to be uniform across all operating systems.
// The package os_old interface is intended to be uniform across all operating systems.
// Features not generally available appear in the system-specific packages under core:sys/*.
package os2
package os

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"
import "core:strings"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"
import "base:intrinsics"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import win32 "core:sys/windows"
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "core:io"
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
_Platform_Error :: enum i32 {}

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "core:sys/linux"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "core:sys/posix"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"
import "core:slice"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "core:io"
import "core:time"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"
import "core:io"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+private
#+build openbsd
package os2
package os
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:intrinsics"
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"
import "core:strconv"

View File

@@ -1,6 +1,6 @@
#+feature global-context
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "core:mem"
import win32 "core:sys/windows"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:intrinsics"
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+build darwin, linux, netbsd, freebsd, openbsd, haiku
package os
package os_old_old
import "core:strings"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import win32 "core:sys/windows"
import "core:strings"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import win32 "core:sys/windows"
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import "base:intrinsics"
import "base:runtime"

View File

@@ -1,5 +1,5 @@
// Cross-platform `OS` interactions like file `I/O`.
package os
package os_old
import "base:intrinsics"
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os
package os_old
foreign import dl "system:dl"
foreign import libc "system:System"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import "core:sys/es"

View File

@@ -1,4 +1,4 @@
package os
package os_old
foreign import dl "system:dl"
foreign import libc "system:c"

View File

@@ -1,4 +1,4 @@
#+build freestanding
package os
package os_old
#panic("package os does not support a freestanding target")
#panic("package os_old does not support a freestanding target")

View File

@@ -1,4 +1,4 @@
package os
package os_old
foreign import lib "system:c"

View File

@@ -1,5 +1,5 @@
#+build js
package os
package os_old
foreign import "odin_env"

View File

@@ -1,4 +1,4 @@
package os
package os_old
foreign import dl "system:dl"
foreign import libc "system:c"
@@ -7,19 +7,8 @@ import "base:runtime"
import "core:strings"
import "core:c"
import "core:strconv"
// NOTE(flysand): For compatibility we'll make core:os package
// depend on the old (scheduled for removal) linux package.
// Seeing that there are plans for os2, I'm imagining that *that*
// package should inherit the new sys functionality.
// The reasons for these are as follows:
// 1. It's very hard to update this package without breaking *a lot* of code.
// 2. os2 is not stable anyways, so we can break compatibility all we want
// It might be weird to bring up compatibility when Odin in it's nature isn't
// all that about compatibility. But we don't want to push experimental changes
// and have people's code break while it's still work in progress.
import unix "core:sys/unix"
import linux "core:sys/linux"
import "core:sys/unix"
import "core:sys/linux"
Handle :: distinct i32
Pid :: distinct i32

View File

@@ -1,4 +1,4 @@
package os
package os_old
foreign import dl "system:dl"
foreign import libc "system:c"

View File

@@ -1,4 +1,4 @@
package os
package os_old
foreign import libc "system:c"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import "core:sys/wasm/wasi"
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+build windows
package os
package os_old
import win32 "core:sys/windows"
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import "core:time"

View File

@@ -1,5 +1,5 @@
#+build linux, darwin, freebsd, openbsd, netbsd, haiku
package os
package os_old
import "core:time"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import "core:time"
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os
package os_old
import "core:io"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"
import "core:slice"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+private
#+build linux, darwin, netbsd, freebsd, openbsd, wasi
package os2
package os
// This implementation is for all systems that have POSIX-compliant filesystem paths.

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"
import "core:strings"

View File

@@ -1,4 +1,4 @@
package os2
package os
/*
Create an anonymous pipe.
@@ -15,7 +15,7 @@ process, that end of the pipe needs to be closed by the parent, before any data
is attempted to be read.
Although pipes look like files and is compatible with most file APIs in package
os2, the way it's meant to be read is different. Due to asynchronous nature of
os, the way it's meant to be read is different. Due to asynchronous nature of
the communication channel, the data may not be present at the time of a read
request. The other scenario is when a pipe has no data because the other end
of the pipe was closed by the child process.

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
_pipe :: proc() -> (r, w: ^File, err: Error) {
err = .Unsupported

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "core:sys/linux"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "core:sys/posix"
import "core:strings"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
_pipe :: proc() -> (r, w: ^File, err: Error) {
err = .Unsupported

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import win32 "core:sys/windows"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+private
#+build freebsd
package os2
package os
import "core:c"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:runtime"
import "core:time"

View File

@@ -1,6 +1,6 @@
#+build linux
#+private file
package os2
package os
import "base:runtime"
import "base:intrinsics"

View File

@@ -1,6 +1,6 @@
#+private
#+build netbsd
package os2
package os
import "core:c"
foreign import libc "system:c"

View File

@@ -1,6 +1,6 @@
#+private
#+build openbsd
package os2
package os
import "core:c"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"
import "base:intrinsics"

View File

@@ -1,6 +1,6 @@
#+private
#+build netbsd, openbsd, freebsd
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private file
package os2
package os
import "base:intrinsics"
import "base:runtime"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"
import "core:strings"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "core:time"
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"
import "core:time"

View File

@@ -1,4 +1,4 @@
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+build js wasm32, js wasm64p32
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,5 +1,5 @@
#+private
package os2
package os
import "base:runtime"

View File

@@ -1,6 +1,6 @@
#+private
#+build darwin, netbsd, freebsd, openbsd
package os2
package os
import "base:runtime"

Some files were not shown because too many files have changed in this diff Show More