diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-10 22:43:34 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-10 22:43:34 +0200 |
| commit | 2ec81876eb59bb3e7c544774aa222988c1f574c4 (patch) | |
| tree | b6eca032fe3071a17ad580d8e178c8383818a02a | |
| parent | d9f40f59c9f14bef7f87c11da7494f7dcf1457b4 (diff) | |
| download | nissy-core-2ec81876eb59bb3e7c544774aa222988c1f574c4.tar.gz nissy-core-2ec81876eb59bb3e7c544774aa222988c1f574c4.zip | |
Fix build errors on OpenBSD
| -rwxr-xr-x | configure.sh | 9 | ||||
| -rw-r--r-- | src/cube_public.h | 6 | ||||
| -rwxr-xr-x | test/test.sh | 5 |
3 files changed, 14 insertions, 6 deletions
diff --git a/configure.sh b/configure.sh index 60e375a..d5586db 100755 --- a/configure.sh +++ b/configure.sh | |||
| @@ -2,8 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | cc=${CC:-cc} | 3 | cc=${CC:-cc} |
| 4 | 4 | ||
| 5 | detectarch() { ${cc} -march=native -dM -E - </dev/null | grep "$1"; } | 5 | detectarch() { |
| 6 | detectsan() { ${cc} -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; } | 6 | ${cc} -march=native -dM -E - </dev/null 2>/dev/null | grep "$1" |
| 7 | } | ||
| 8 | detectsan() { | ||
| 9 | ${cc} -fsanitize=$1 -dM -E -x c - </dev/null 2>/dev/null \ | ||
| 10 | | grep "SANITIZE" | ||
| 11 | } | ||
| 7 | 12 | ||
| 8 | [ -n "$(detectarch __AVX2__)" ] && detected="AVX2" | 13 | [ -n "$(detectarch __AVX2__)" ] && detected="AVX2" |
| 9 | [ -n "$(detectarch __ARM_NEON)" ] && detected="NEON" | 14 | [ -n "$(detectarch __ARM_NEON)" ] && detected="NEON" |
diff --git a/src/cube_public.h b/src/cube_public.h index 7f7b81c..ade8778 100644 --- a/src/cube_public.h +++ b/src/cube_public.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | int check(cube_t, char [static 22]); | 1 | int check_error(cube_t, char [static 22]); |
| 2 | 2 | ||
| 3 | int | 3 | int |
| 4 | check(cube_t cube, char result[static 22]) | 4 | check_error(cube_t cube, char result[static 22]) |
| 5 | { | 5 | { |
| 6 | if (!isconsistent(cube)) { | 6 | if (!isconsistent(cube)) { |
| 7 | writecube("B32", zero, result); | 7 | writecube("B32", zero, result); |
| @@ -25,7 +25,7 @@ nissy_compose( | |||
| 25 | 25 | ||
| 26 | res = compose(c, p); | 26 | res = compose(c, p); |
| 27 | 27 | ||
| 28 | return check(res, result); | 28 | return check_error(res, result); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | int | 31 | int |
diff --git a/test/test.sh b/test/test.sh index 3adee3a..8e50cf5 100755 --- a/test/test.sh +++ b/test/test.sh | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; } | 3 | detectsan() { |
| 4 | cc -fsanitize=$1 -dM -E -x c - </dev/null 2>/dev/null \ | ||
| 5 | | grep "SANITIZE" | ||
| 6 | } | ||
| 4 | 7 | ||
| 5 | re="${TEST:-$@}" | 8 | re="${TEST:-$@}" |
| 6 | 9 | ||
