hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 374e0e2138ebee4dad1d6891f18793cc15741255
parent b493cf9abe5e99e9446780df0b375c1db6fe5539
Author: Sebastian <sebastian@sebsite.pw>
Date:   Fri, 12 May 2023 21:30:07 -0400

os: move status type to separate file

So it's now available for +test, without needlessly duplicating it.

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mos/+freebsd/exit.ha | 7-------
Aos/+freebsd/status.ha | 6++++++
Mos/+linux/exit.ha | 7-------
Aos/+linux/status.ha | 6++++++
Mscripts/gen-stdlib | 2++
Mstdlib.mk | 4++++
6 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/os/+freebsd/exit.ha b/os/+freebsd/exit.ha @@ -2,13 +2,6 @@ // (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; -// Values that may be passed to [[exit]] to indicate successful or unsuccessful -// termination, respectively. -export type status = enum { - SUCCESS = 0, - FAILURE = 1, -}; - // Exit the program with the provided status code. export @noreturn fn exit(status: int) void = { rt::fini(); diff --git a/os/+freebsd/status.ha b/os/+freebsd/status.ha @@ -0,0 +1,6 @@ +// Values that may be passed to [[exit]] to indicate successful or unsuccessful +// termination, respectively. +export type status = enum { + SUCCESS = 0, + FAILURE = 1, +}; diff --git a/os/+linux/exit.ha b/os/+linux/exit.ha @@ -2,13 +2,6 @@ // (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; -// Values that may be passed to [[exit]] to indicate successful or unsuccessful -// termination, respectively. -export type status = enum { - SUCCESS = 0, - FAILURE = 1, -}; - // Exit the program with the provided status code. export @noreturn fn exit(status: int) void = { rt::fini(); diff --git a/os/+linux/status.ha b/os/+linux/status.ha @@ -0,0 +1,6 @@ +// Values that may be passed to [[exit]] to indicate successful or unsuccessful +// termination, respectively. +export type status = enum { + SUCCESS = 0, + FAILURE = 1, +}; diff --git a/scripts/gen-stdlib b/scripts/gen-stdlib @@ -1158,6 +1158,7 @@ os() { +linux/$exit \ +linux/fs.ha \ +linux/memory.ha \ + +linux/status.ha \ +linux/stdfd.ha \ os.ha gen_ssa -plinux os io strings fs encoding::utf8 bytes bufio \ @@ -1167,6 +1168,7 @@ os() { +freebsd/environ.ha \ +freebsd/$exit \ +freebsd/dirfdfs.ha \ + +freebsd/status.ha \ +freebsd/stdfd.ha \ +freebsd/fs.ha \ os.ha diff --git a/stdlib.mk b/stdlib.mk @@ -1883,6 +1883,7 @@ stdlib_os_linux_srcs = \ $(STDLIB)/os/+linux/exit.ha \ $(STDLIB)/os/+linux/fs.ha \ $(STDLIB)/os/+linux/memory.ha \ + $(STDLIB)/os/+linux/status.ha \ $(STDLIB)/os/+linux/stdfd.ha \ $(STDLIB)/os/os.ha @@ -1897,6 +1898,7 @@ stdlib_os_freebsd_srcs = \ $(STDLIB)/os/+freebsd/environ.ha \ $(STDLIB)/os/+freebsd/exit.ha \ $(STDLIB)/os/+freebsd/dirfdfs.ha \ + $(STDLIB)/os/+freebsd/status.ha \ $(STDLIB)/os/+freebsd/stdfd.ha \ $(STDLIB)/os/+freebsd/fs.ha \ $(STDLIB)/os/os.ha @@ -4332,6 +4334,7 @@ testlib_os_linux_srcs = \ $(STDLIB)/os/+linux/exit+test.ha \ $(STDLIB)/os/+linux/fs.ha \ $(STDLIB)/os/+linux/memory.ha \ + $(STDLIB)/os/+linux/status.ha \ $(STDLIB)/os/+linux/stdfd.ha \ $(STDLIB)/os/os.ha @@ -4346,6 +4349,7 @@ testlib_os_freebsd_srcs = \ $(STDLIB)/os/+freebsd/environ.ha \ $(STDLIB)/os/+freebsd/exit+test.ha \ $(STDLIB)/os/+freebsd/dirfdfs.ha \ + $(STDLIB)/os/+freebsd/status.ha \ $(STDLIB)/os/+freebsd/stdfd.ha \ $(STDLIB)/os/+freebsd/fs.ha \ $(STDLIB)/os/os.ha