Fix building in ReleaseSafe

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2026-04-25 09:49:22 +02:00
commit a91b538236
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: Including <fcntl.h> with -OReleaseSafe causes
// __attribute__(__error__()) to be called. Below
// is the workaround.
translate_c.defineCMacro("_FORTIFY_SOURCE", "0");
// TODO 0.16.0: Needed for now
if (target.result.os.tag == .freebsd) {
translate_c.defineCMacro("__BSD_VISIBLE", "1");