Define __BSD_VISIBLE for FreeBSD

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2026-04-18 09:33:31 +02:00
commit d7d634ba74
No known key found for this signature in database

View file

@ -27,6 +27,10 @@ pub fn build(b: *std.Build) void {
// https://codeberg.org/ziglang/translate-c/issues/319
translate_c.defineCMacro("_XOPEN_SOURCE", "700");
translate_c.defineCMacro("TB_OPT_ATTR_W", "32"); // Enable 24-bit color support + styling (32-bit)
// TODO 0.16.0: Needed for now
if (target.result.os.tag == .freebsd) {
translate_c.defineCMacro("__BSD_VISIBLE", "1");
}
const termbox2 = translate_c.addModule("termbox2");
mod.addImport("termbox2", termbox2);