mirror of
https://github.com/fairyglade/ly.git
synced 2026-05-06 07:10:36 +00:00
Remove further & all @cImport() usage in interop
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -36,6 +36,14 @@ pub fn build(b: *std.Build) void {
|
|||||||
addCImport(b, mod, translate_c, target, optimize, "system_time", "#include <sys/time.h>");
|
addCImport(b, mod, translate_c, target, optimize, "system_time", "#include <sys/time.h>");
|
||||||
addCImport(b, mod, translate_c, target, optimize, "time", "#include <time.h>");
|
addCImport(b, mod, translate_c, target, optimize, "time", "#include <time.h>");
|
||||||
|
|
||||||
|
if (target.result.os.tag == .linux) {
|
||||||
|
addCImport(b, mod, translate_c, target, optimize, "kd", "#include <sys/kd.h>");
|
||||||
|
addCImport(b, mod, translate_c, target, optimize, "vt", "#include <sys/vt.h>");
|
||||||
|
} else if (target.result.os.tag == .freebsd) {
|
||||||
|
addCImport(b, mod, translate_c, target, optimize, "kbio", "#include <sys/kbio.h>");
|
||||||
|
addCImport(b, mod, translate_c, target, optimize, "consio", "#include <sys/consio.h>");
|
||||||
|
}
|
||||||
|
|
||||||
const mod_tests = b.addTest(.{
|
const mod_tests = b.addTest(.{
|
||||||
.root_module = mod,
|
.root_module = mod,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,13 +31,8 @@ pub const UsernameEntry = struct {
|
|||||||
fn PlatformStruct() type {
|
fn PlatformStruct() type {
|
||||||
return switch (builtin.os.tag) {
|
return switch (builtin.os.tag) {
|
||||||
.linux => struct {
|
.linux => struct {
|
||||||
pub const kd = @cImport({
|
pub const kd = @import("kd");
|
||||||
@cInclude("sys/kd.h");
|
pub const vt = @import("vt");
|
||||||
});
|
|
||||||
|
|
||||||
pub const vt = @cImport({
|
|
||||||
@cInclude("sys/vt.h");
|
|
||||||
});
|
|
||||||
|
|
||||||
pub const LedState = c_char;
|
pub const LedState = c_char;
|
||||||
pub const get_led_state = kd.KDGKBLED;
|
pub const get_led_state = kd.KDGKBLED;
|
||||||
@@ -197,13 +192,8 @@ fn PlatformStruct() type {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
.freebsd => struct {
|
.freebsd => struct {
|
||||||
pub const kbio = @cImport({
|
pub const kbio = @import("kbio");
|
||||||
@cInclude("sys/kbio.h");
|
pub const consio = @import("consio");
|
||||||
});
|
|
||||||
|
|
||||||
pub const consio = @cImport({
|
|
||||||
@cInclude("sys/consio.h");
|
|
||||||
});
|
|
||||||
|
|
||||||
pub const LedState = c_int;
|
pub const LedState = c_int;
|
||||||
pub const get_led_state = kbio.KDGETLED;
|
pub const get_led_state = kbio.KDGETLED;
|
||||||
|
|||||||
Reference in New Issue
Block a user