Skip to content

Commit

Permalink
Merge pull request #13 from brad0/openbsd_elf_aux_info
Browse files Browse the repository at this point in the history
Add support for OpenBSD ARM and RISC-V detection
  • Loading branch information
animetosho authored Aug 6, 2024
2 parents be88b9f + defe891 commit f2a5244
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/crc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ namespace RapidYenc {
# elif defined(__has_include)
# if __has_include(<sys/auxv.h>)
# include <sys/auxv.h>
# ifdef __FreeBSD__
# if defined(__FreeBSD__) || defined(__OpenBSD__)
static unsigned long getauxval(unsigned long cap) {
unsigned long ret;
elf_aux_info(cap, &ret, sizeof(ret));
Expand Down
4 changes: 2 additions & 2 deletions src/platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# endif
bool RapidYenc::cpu_supports_neon() {
# if defined(AT_HWCAP)
# ifdef __FreeBSD__
# if defined(__FreeBSD__) || defined(__OpenBSD__)
unsigned long supported;
elf_aux_info(AT_HWCAP, &supported, sizeof(supported));
# ifdef __aarch64__
Expand Down Expand Up @@ -204,7 +204,7 @@ int RapidYenc::cpu_supports_crc_isa() {
bool RapidYenc::cpu_supports_rvv() {
# if defined(AT_HWCAP)
unsigned long ret;
# ifdef __FreeBSD__
# if defined(__FreeBSD__) || defined(__OpenBSD__)
elf_aux_info(AT_HWCAP, &ret, sizeof(ret));
# else
ret = getauxval(AT_HWCAP);
Expand Down

0 comments on commit f2a5244

Please sign in to comment.