summaryrefslogtreecommitdiff
path: root/tests/header_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/header_test.sh')
-rw-r--r--tests/header_test.sh9
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