mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
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.
This commit is contained in:
parent
40f9dff5d6
commit
d910ed8b9f
2 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue