From 60b66fce58b64d121b124e64ef78d37512e3a8a2 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Wed, 28 Aug 2024 10:15:54 +0200 Subject: Re-add FreeBSD support (broken since c1a64c1) (#33) Co-authored-by: cos --- src/term.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/term.c b/src/term.c index e58e190..4deb5f1 100644 --- a/src/term.c +++ b/src/term.c @@ -166,7 +166,7 @@ static const struct ls_RegConst nix_console_i_flags[] = { {"I_INLCR", CHECK_NIX_FLAG_OR_ZERO(INLCR)}, {"I_IGNCR", CHECK_NIX_FLAG_OR_ZERO(IGNCR)}, {"I_ICRNL", CHECK_NIX_FLAG_OR_ZERO(ICRNL)}, -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__FreeBSD__) {"I_IUCLC", CHECK_NIX_FLAG_OR_ZERO(IUCLC)}, // Might not be available on all systems #else {"I_IUCLC", 0}, @@ -181,7 +181,7 @@ static const struct ls_RegConst nix_console_i_flags[] = { static const struct ls_RegConst nix_console_o_flags[] = { // Output flags (c_oflag) {"O_OPOST", CHECK_NIX_FLAG_OR_ZERO(OPOST)}, -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__FreeBSD__) {"O_OLCUC", CHECK_NIX_FLAG_OR_ZERO(OLCUC)}, // Might not be available on all systems #else {"O_OLCUC", 0}, @@ -190,14 +190,27 @@ static const struct ls_RegConst nix_console_o_flags[] = { {"O_OCRNL", CHECK_NIX_FLAG_OR_ZERO(OCRNL)}, {"O_ONOCR", CHECK_NIX_FLAG_OR_ZERO(ONOCR)}, {"O_ONLRET", CHECK_NIX_FLAG_OR_ZERO(ONLRET)}, +#ifndef __FreeBSD__ {"O_OFILL", CHECK_NIX_FLAG_OR_ZERO(OFILL)}, {"O_OFDEL", CHECK_NIX_FLAG_OR_ZERO(OFDEL)}, {"O_NLDLY", CHECK_NIX_FLAG_OR_ZERO(NLDLY)}, {"O_CRDLY", CHECK_NIX_FLAG_OR_ZERO(CRDLY)}, +#else + {"O_OFILL", 0}, + {"O_OFDEL", 0}, + {"O_NLDLY", 0}, + {"O_CRDLY", 0}, +#endif {"O_TABDLY", CHECK_NIX_FLAG_OR_ZERO(TABDLY)}, +#ifndef __FreeBSD__ {"O_BSDLY", CHECK_NIX_FLAG_OR_ZERO(BSDLY)}, {"O_VTDLY", CHECK_NIX_FLAG_OR_ZERO(VTDLY)}, {"O_FFDLY", CHECK_NIX_FLAG_OR_ZERO(FFDLY)}, +#else + {"O_BSDLY", 0}, + {"O_VTDLY", 0}, + {"O_FFDLY", 0}, +#endif {NULL, 0} }; @@ -205,7 +218,7 @@ static const struct ls_RegConst nix_console_l_flags[] = { // Local flags (c_lflag) {"L_ISIG", CHECK_NIX_FLAG_OR_ZERO(ISIG)}, {"L_ICANON", CHECK_NIX_FLAG_OR_ZERO(ICANON)}, -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__FreeBSD__) {"L_XCASE", CHECK_NIX_FLAG_OR_ZERO(XCASE)}, // Might not be available on all systems #else {"L_XCASE", 0}, -- cgit v1.2.3-55-g6feb