commit 2ec81876eb59bb3e7c544774aa222988c1f574c4
parent d9f40f59c9f14bef7f87c11da7494f7dcf1457b4
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Mon, 10 Jun 2024 22:43:34 +0200
Fix build errors on OpenBSD
Diffstat:
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/configure.sh b/configure.sh
@@ -2,8 +2,13 @@
cc=${CC:-cc}
-detectarch() { ${cc} -march=native -dM -E - </dev/null | grep "$1"; }
-detectsan() { ${cc} -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; }
+detectarch() {
+ ${cc} -march=native -dM -E - </dev/null 2>/dev/null | grep "$1"
+}
+detectsan() {
+ ${cc} -fsanitize=$1 -dM -E -x c - </dev/null 2>/dev/null \
+ | grep "SANITIZE"
+}
[ -n "$(detectarch __AVX2__)" ] && detected="AVX2"
[ -n "$(detectarch __ARM_NEON)" ] && detected="NEON"
diff --git a/src/cube_public.h b/src/cube_public.h
@@ -1,7 +1,7 @@
-int check(cube_t, char [static 22]);
+int check_error(cube_t, char [static 22]);
int
-check(cube_t cube, char result[static 22])
+check_error(cube_t cube, char result[static 22])
{
if (!isconsistent(cube)) {
writecube("B32", zero, result);
@@ -25,7 +25,7 @@ nissy_compose(
res = compose(c, p);
- return check(res, result);
+ return check_error(res, result);
}
int
diff --git a/test/test.sh b/test/test.sh
@@ -1,6 +1,9 @@
#!/bin/sh
-detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; }
+detectsan() {
+ cc -fsanitize=$1 -dM -E -x c - </dev/null 2>/dev/null \
+ | grep "SANITIZE"
+}
re="${TEST:-$@}"