Skip to content
Snippets Groups Projects
Commit d910ed8b authored by Yorhel's avatar Yorhel
Browse files

Add workaround for Zig bug on FreeBSD

The good news is: apart from this little thing, everything seems to just
work(tm) on FreeBSD. Think I had more trouble with C because of minor
header file differences.
parent 40f9dff5
No related branches found
No related tags found
No related merge requests found
......@@ -21,3 +21,6 @@ chtype ncdu_acs_urcorner() { return ACS_URCORNER; }
chtype ncdu_acs_lrcorner() { return ACS_LRCORNER; }
chtype ncdu_acs_hline() { return ACS_VLINE ; }
chtype ncdu_acs_vline() { return ACS_HLINE ; }
/* https://github.com/ziglang/zig/issues/8947 */
void ncdu_init_pair(short a,b,c) { init_pair(a,b,c); }
......@@ -184,6 +184,7 @@ extern fn ncdu_acs_urcorner() c.chtype;
extern fn ncdu_acs_lrcorner() c.chtype;
extern fn ncdu_acs_hline() c.chtype;
extern fn ncdu_acs_vline() c.chtype;
extern fn ncdu_init_pair(idx: c_short, fg: c_short, bg: c_short) void;
const StyleAttr = struct { fg: i16, bg: i16, attr: u32 };
const StyleDef = struct {
......@@ -334,7 +335,7 @@ pub fn init() void {
_ = c.start_color();
_ = c.use_default_colors();
for (styles) |s, i| _ = c.init_pair(@intCast(i16, i+1), s.style().fg, s.style().bg);
for (styles) |s, i| _ = ncdu_init_pair(@intCast(i16, i+1), s.style().fg, s.style().bg);
inited = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment