From 71f0b19476adb170c24d6a8de4ab3133701b1aeb Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 20:39:36 +0300 Subject: Fix macOS builds on Apple Silicon and Intel --- tests/header_test.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/header_test.sh') diff --git a/tests/header_test.sh b/tests/header_test.sh index 6636418..4ba091b 100644 --- a/tests/header_test.sh +++ b/tests/header_test.sh @@ -13,4 +13,13 @@ if command -v "$cxx" >/dev/null; then echo '#include "term.h"' | "$cxx" -std=c++17 -Wall -Wextra -Wpedantic -Werror \ -Iinclude/term -x c++ -fsyntax-only - || { echo "term.h: not valid C++" >&2; status=1; } fi + +# Apple headers define wide before a host includes the Unicode API. +unicode_header=$'typedef struct wide { int value; } wide;\n#include "unicode/width.h"' +echo "$unicode_header" | "$cc" -std=c11 -Wall -Wextra -Wpedantic -Werror \ + -Iinclude/term -x c -fsyntax-only - || { echo "unicode/width.h: conflicts with host types" >&2; status=1; } +if command -v "$cxx" >/dev/null; then + echo "$unicode_header" | "$cxx" -std=c++17 -Wall -Wextra -Wpedantic -Werror \ + -Iinclude/term -x c++ -fsyntax-only - || { echo "unicode/width.h: conflicts with C++ host types" >&2; status=1; } +fi exit $status -- cgit v1.2.3