mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
make new extern functions compile on windows
This commit is contained in:
parent
9840cd53df
commit
b6b7d186e4
8 changed files with 57 additions and 0 deletions
|
@ -74,6 +74,10 @@ fn roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
@ -91,6 +95,10 @@ comptime {
|
||||||
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
||||||
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtin.os.tag == .windows) {
|
||||||
|
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Unit = extern struct {};
|
const Unit = extern struct {};
|
||||||
|
|
|
@ -73,6 +73,10 @@ fn roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
@ -90,6 +94,10 @@ comptime {
|
||||||
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
||||||
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtin.os.tag == .windows) {
|
||||||
|
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Unit = extern struct {};
|
const Unit = extern struct {};
|
||||||
|
|
|
@ -90,6 +90,10 @@ fn roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,10 @@ fn roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
@ -106,6 +110,10 @@ comptime {
|
||||||
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
||||||
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtin.os.tag == .windows) {
|
||||||
|
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// warning! the array is currently stack-allocated so don't make this too big
|
// warning! the array is currently stack-allocated so don't make this too big
|
||||||
|
|
|
@ -94,6 +94,10 @@ fn roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
@ -111,6 +115,10 @@ comptime {
|
||||||
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
||||||
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtin.os.tag == .windows) {
|
||||||
|
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Unit = extern struct {};
|
const Unit = extern struct {};
|
||||||
|
|
|
@ -30,6 +30,11 @@ extern fn getppid() c_int;
|
||||||
fn testing_roc_getppid() callconv(.C) c_int {
|
fn testing_roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn testing_roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn testing_roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,10 @@ fn roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
@ -170,6 +174,10 @@ comptime {
|
||||||
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
||||||
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtin.os.tag == .windows) {
|
||||||
|
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Unit = extern struct {};
|
const Unit = extern struct {};
|
||||||
|
|
|
@ -84,6 +84,10 @@ fn roc_getppid() callconv(.C) c_int {
|
||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn roc_getppid_windows_stub() callconv(.C) c_int {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
fn roc_send_signal(pid: c_int, sig: c_int) callconv(.C) c_int {
|
||||||
return kill(pid, sig);
|
return kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
@ -101,6 +105,10 @@ comptime {
|
||||||
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
@export(roc_send_signal, .{ .name = "roc_send_signal", .linkage = .Strong });
|
||||||
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builtin.os.tag == .windows) {
|
||||||
|
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const mem = std.mem;
|
const mem = std.mem;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue