diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 20:39:36 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 20:39:36 +0300 |
| commit | 71f0b19476adb170c24d6a8de4ab3133701b1aeb (patch) | |
| tree | 4035f3fe33b38782b96cfdde087dd566256eda92 /tests/header_test.sh | |
| parent | d505017cec86c000f891b003f5ca3481f5ffae61 (diff) | |
Fix macOS builds on Apple Silicon and Intel
Diffstat (limited to 'tests/header_test.sh')
| -rw-r--r-- | tests/header_test.sh | 9 |
1 files changed, 9 insertions, 0 deletions
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 |
