mirror of
https://github.com/roc-lang/roc.git
synced 2024-08-16 22:30:58 +03:00
switch dbg arg ordering to make it backwards compatible
This commit is contained in:
parent
6c60da2832
commit
787d7f85ac
@ -52,7 +52,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
// This platform uses stdout for testing purposes instead of the normal stderr.
|
||||
const stdout = std.io.getStdOut().writer();
|
||||
stdout.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
|
@ -3,7 +3,7 @@ const builtin = @import("builtin");
|
||||
const RocStr = @import("str.zig").RocStr;
|
||||
|
||||
// An optional debug impl to be called during `roc test`
|
||||
pub fn dbg_impl(loc: *const RocStr, src: *const RocStr, msg: *const RocStr) callconv(.C) void {
|
||||
pub fn dbg_impl(loc: *const RocStr, msg: *const RocStr, src: *const RocStr) callconv(.C) void {
|
||||
if (builtin.target.cpu.arch != .wasm32) {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
|
@ -20,11 +20,11 @@ extern fn roc_realloc(c_ptr: *anyopaque, new_size: usize, old_size: usize, align
|
||||
// This should never be passed a null pointer.
|
||||
extern fn roc_dealloc(c_ptr: *anyopaque, alignment: u32) callconv(.C) void;
|
||||
|
||||
extern fn roc_dbg(loc: *anyopaque, src: *anyopaque, message: *anyopaque) callconv(.C) void;
|
||||
extern fn roc_dbg(loc: *anyopaque, message: *anyopaque, src: *anyopaque) callconv(.C) void;
|
||||
|
||||
// Since roc_dbg is never used by the builtins, we need at export a function that uses it to stop DCE.
|
||||
pub fn test_dbg(loc: *anyopaque, src: *anyopaque, message: *anyopaque) callconv(.C) void {
|
||||
roc_dbg(loc, src, message);
|
||||
roc_dbg(loc, message, src);
|
||||
}
|
||||
|
||||
extern fn kill(pid: c_int, sig: c_int) c_int;
|
||||
@ -47,7 +47,7 @@ fn testing_roc_mmap(addr: ?*anyopaque, length: c_uint, prot: c_int, flags: c_int
|
||||
return mmap(addr, length, prot, flags, fd, offset);
|
||||
}
|
||||
|
||||
fn testing_roc_dbg(loc: *anyopaque, src: *anyopaque, message: *anyopaque) callconv(.C) void {
|
||||
fn testing_roc_dbg(loc: *anyopaque, message: *anyopaque, src: *anyopaque) callconv(.C) void {
|
||||
_ = message;
|
||||
_ = src;
|
||||
_ = loc;
|
||||
|
@ -919,9 +919,10 @@ impl<'a, 'ctx, 'env> Env<'a, 'ctx, 'env> {
|
||||
let src = self.string_to_arg(env, source);
|
||||
let msg = self.string_to_arg(env, message);
|
||||
|
||||
// TODO: at some point it will be a breaking change, but flip order to (loc, src, msg)
|
||||
let call =
|
||||
self.builder
|
||||
.new_build_call(function, &[loc.into(), src.into(), msg.into()], "roc_dbg");
|
||||
.new_build_call(function, &[loc.into(), msg.into(), src.into()], "roc_dbg");
|
||||
|
||||
call.set_call_convention(C_CALL_CONV);
|
||||
}
|
||||
|
@ -167,8 +167,8 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
|
||||
let fn_val = module.get_function("roc_dbg").unwrap();
|
||||
let mut params = fn_val.get_param_iter();
|
||||
let loc_arg = params.next().unwrap();
|
||||
let src_arg = params.next().unwrap();
|
||||
let msg_arg = params.next().unwrap();
|
||||
let src_arg = params.next().unwrap();
|
||||
|
||||
debug_assert!(params.next().is_none());
|
||||
|
||||
@ -181,7 +181,7 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
|
||||
let dbg_impl = module.get_function(bitcode::UTILS_DBG_IMPL).unwrap();
|
||||
let call = builder.new_build_call(
|
||||
dbg_impl,
|
||||
&[loc_arg.into(), src_arg.into(), msg_arg.into()],
|
||||
&[loc_arg.into(), msg_arg.into(), src_arg.into()],
|
||||
"call_utils_dbg_impl",
|
||||
);
|
||||
|
||||
|
@ -290,7 +290,7 @@ mod dummy_platform_functions {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(_loc: *mut c_void, _src: *mut c_void, _msg: *mut c_void) {
|
||||
pub unsafe extern "C" fn roc_dbg(_loc: *mut c_void, _msg: *mut c_void, _src: *mut c_void) {
|
||||
unimplemented!("It is not valid to call roc dbg from within the compiler. Please use the \"platform\" feature if this is a platform.")
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
2
crates/glue/tests/fixtures/option/src/lib.rs
vendored
2
crates/glue/tests/fixtures/option/src/lib.rs
vendored
@ -51,7 +51,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ extern "C" {
|
||||
) -> *mut c_void;
|
||||
pub fn roc_dealloc(ptr: *mut c_void, alignment: u32);
|
||||
pub fn roc_panic(c_ptr: *mut c_void, tag_id: u32);
|
||||
pub fn roc_dbg(loc: *mut c_void, src: *mut c_void, msg: *mut c_void);
|
||||
pub fn roc_dbg(loc: *mut c_void, msg: *mut c_void, src: *mut c_void);
|
||||
pub fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void;
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,8 @@ pub unsafe extern "C" fn roc_panic(msg: *mut roc_std::RocStr, _tag_id: u32) {
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(
|
||||
loc: *mut roc_std::RocStr,
|
||||
src: *mut roc_std::RocStr,
|
||||
msg: *mut roc_std::RocStr,
|
||||
src: *mut roc_std::RocStr,
|
||||
) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -275,7 +275,7 @@ __attribute__((noreturn)) void roc_panic(struct RocStr *msg, unsigned int tag_id
|
||||
longjmp(exception_buffer, 1);
|
||||
}
|
||||
|
||||
void roc_dbg(struct RocStr *loc, struct RocStr *src, struct RocStr *msg) {
|
||||
void roc_dbg(struct RocStr *loc, struct RocStr *msg, struct RocStr *src) {
|
||||
char* loc_bytes = is_small_str(*loc) ? (char*)loc : (char*)loc->bytes;
|
||||
char* src_bytes = is_small_str(*src) ? (char*)src : (char*)src->bytes;
|
||||
char* msg_bytes = is_small_str(*msg) ? (char*)msg : (char*)msg->bytes;
|
||||
|
@ -27,7 +27,7 @@ void roc_panic(void *ptr, unsigned int alignment)
|
||||
napi_throw_error(napi_global_env, NULL, (char *)ptr);
|
||||
}
|
||||
|
||||
void roc_dbg(char* loc, char* src, char* msg) {
|
||||
void roc_dbg(char* loc, char* msg, char* src) {
|
||||
fprintf(stderr, "[%s] %s = %s\n", loc, src, msg);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ void roc_panic(void* ptr, unsigned int alignment) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void roc_dbg(char* loc, char* src, char* msg) {
|
||||
void roc_dbg(char* loc, char* msg, char* src) {
|
||||
fprintf(stderr, "[%s] %s = %s\n", loc, src, msg);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ __attribute__((noreturn)) void roc_panic(void *ptr, unsigned int alignment)
|
||||
PyErr_SetString(PyExc_RuntimeError, (char *)ptr);
|
||||
}
|
||||
|
||||
void roc_dbg(char* loc, char* src, char* msg) {
|
||||
void roc_dbg(char* loc, char* msg, char* src) {
|
||||
fprintf(stderr, "[%s] %s = %s\n", loc, src, msg);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ void roc_panic(void* ptr, unsigned int alignment) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void roc_dbg(char* loc, char* src, char* msg) {
|
||||
void roc_dbg(char* loc, char* msg, char* src) {
|
||||
fprintf(stderr, "[%s] %s = %s\n", loc, src, msg);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ __attribute__((noreturn)) void roc_panic(void *ptr, unsigned int alignment)
|
||||
rb_raise(rb_eException, "%s", (char *)ptr);
|
||||
}
|
||||
|
||||
void roc_dbg(char* loc, char* src, char* msg) {
|
||||
void roc_dbg(char* loc, char* msg, char* src) {
|
||||
fprintf(stderr, "[%s] %s = %s\n", loc, src, msg);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ void roc_panic(void* ptr, unsigned int alignment) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void roc_dbg(char* loc, char* src, char* msg) {
|
||||
void roc_dbg(char* loc, char* msg, char* src) {
|
||||
fprintf(stderr, "[%s] %s = %s\n", loc, src, msg);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ pub unsafe extern "C" fn roc_panic(msg: *mut RocStr, tag_id: u32) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, src: *mut RocStr, msg: *mut RocStr) {
|
||||
pub unsafe extern "C" fn roc_dbg(loc: *mut RocStr, msg: *mut RocStr, src: *mut RocStr) {
|
||||
eprintln!("[{}] {} = {}", &*loc, &*src, &*msg);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
export fn roc_dbg(loc: *RocStr, src: *RocStr, msg: *RocStr) callconv(.C) void {
|
||||
export fn roc_dbg(loc: *RocStr, msg: *RocStr, src: *RocStr) callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("[{s}] {s} = {s}\n", .{ loc.asSlice(), src.asSlice(), msg.asSlice() }) catch unreachable;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user