hare

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

commit 76d7d0efdab1d94df0f1c795b868193a8758c556
parent 32f41590febed2bce40636146614192e105487ae
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sun,  1 Dec 2024 20:36:36 -0500

rt: rename jmpbuf to jmp_buf

So it's spelled the same as it is in C.

This is a breaking change.

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

Diffstat:
Mrt/+aarch64/arch_jmp.ha | 2+-
Mrt/+riscv64/arch_jmp.ha | 2+-
Mrt/+x86_64/arch_jmp.ha | 2+-
Mrt/abort+test.ha | 4++--
Mrt/jmp.ha | 8++++----
Mtest/+test.ha | 8++++----
Mtest/util+test.ha | 2+-
7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/rt/+aarch64/arch_jmp.ha b/rt/+aarch64/arch_jmp.ha @@ -1,4 +1,4 @@ // SPDX-License-Identifier: MPL-2.0 // (c) Hare authors <https://harelang.org> -export type arch_jmpbuf = [22]u64; +export type arch_jmp_buf = [22]u64; diff --git a/rt/+riscv64/arch_jmp.ha b/rt/+riscv64/arch_jmp.ha @@ -1,4 +1,4 @@ // SPDX-License-Identifier: MPL-2.0 // (c) Hare authors <https://harelang.org> -export type arch_jmpbuf = [26]u64; +export type arch_jmp_buf = [26]u64; diff --git a/rt/+x86_64/arch_jmp.ha b/rt/+x86_64/arch_jmp.ha @@ -1,4 +1,4 @@ // SPDX-License-Identifier: MPL-2.0 // (c) Hare authors <https://harelang.org> -export type arch_jmpbuf = [8]u64; +export type arch_jmp_buf = [8]u64; diff --git a/rt/abort+test.ha b/rt/abort+test.ha @@ -21,7 +21,7 @@ export type abort_reason = struct { msg: str, }; -export let jmp: nullable *jmpbuf = null; +export let jmp: nullable *jmp_buf = null; export let reason: abort_reason = abort_reason { ... }; export @symbol("rt.abort") fn _abort( @@ -31,7 +31,7 @@ export @symbol("rt.abort") fn _abort( msg: str, ) void = { match (jmp) { - case let j: *jmpbuf => + case let j: *jmp_buf => reason = abort_reason { path = path, line = line, diff --git a/rt/jmp.ha b/rt/jmp.ha @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MPL-2.0 // (c) Hare authors <https://harelang.org> -export type jmpbuf = struct { - __jb: arch_jmpbuf, +export type jmp_buf = struct { + __jb: arch_jmp_buf, __fl: size, __ss: [128 / size(size)]size, }; -export fn setjmp(buf: *jmpbuf) int; +export fn setjmp(buf: *jmp_buf) int; -export fn longjmp(buf: *jmpbuf, n: int) never; +export fn longjmp(buf: *jmp_buf, n: int) never; diff --git a/test/+test.ha b/test/+test.ha @@ -80,7 +80,7 @@ fn colored() bool = { && tty::isatty(os::stdout_file); }; -let jmpbuf = rt::jmpbuf { ... }; +let jmp_buf = rt::jmp_buf { ... }; const @symbol("__test_array_start") test_start: [*]test; const @symbol("__test_array_end") test_end: [*]test; @@ -244,9 +244,9 @@ fn run_test(ctx: *context, test: test) status = { os::stdout = &ctx.stdout; os::stderr = &ctx.stderr; defer rt::jmp = null; - const n = rt::setjmp(&jmpbuf): status; + const n = rt::setjmp(&jmp_buf): status; if (n == status::RETURN) { - rt::jmp = &jmpbuf; + rt::jmp = &jmp_buf; test.func(); }; @@ -345,7 +345,7 @@ fn handle_segv( info: *signal::siginfo, ucontext: *opaque, ) void = { - rt::longjmp(&jmpbuf, status::SEGV); + rt::longjmp(&jmp_buf, status::SEGV); }; fn easter_egg(fails: []failure, tests: []test) void = { diff --git a/test/util+test.ha b/test/util+test.ha @@ -26,7 +26,7 @@ export fn skip(reason: str) never = { msg = reason, ... }; - rt::longjmp(&jmpbuf, status::SKIP); + rt::longjmp(&jmp_buf, status::SKIP); }; // Check the $HARETEST_INCLUDE space-delimited environment variable for