Skip to content

Commit

Permalink
seems to fix compilation on M1 Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Nov 24, 2020
1 parent 48bfca3 commit ed1882e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions util/crc32c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static bool isAltiVec() {
}
#endif

#if defined(__linux__) && defined(HAVE_ARM64_CRC)
#if defined(HAVE_ARM64_CRC)
uint32_t ExtendARMImpl(uint32_t crc, const char *buf, size_t size) {
return crc32c_arm64(crc, (const unsigned char *)buf, size);
}
Expand All @@ -490,7 +490,7 @@ std::string IsFastCrc32Supported() {
has_fast_crc = false;
arch = "PPC";
#endif
#elif defined(__linux__) && defined(HAVE_ARM64_CRC)
#elif defined(HAVE_ARM64_CRC)
if (crc32c_runtime_check()) {
has_fast_crc = true;
arch = "Arm64";
Expand Down Expand Up @@ -1222,7 +1222,7 @@ uint32_t crc32c_3way(uint32_t crc, const char* buf, size_t len) {
static inline Function Choose_Extend() {
#ifdef HAVE_POWER8
return isAltiVec() ? ExtendPPCImpl : ExtendImpl<Slow_CRC32>;
#elif defined(__linux__) && defined(HAVE_ARM64_CRC)
#elif defined(HAVE_ARM64_CRC)
if(crc32c_runtime_check()) {
return ExtendARMImpl;
} else {
Expand Down
4 changes: 3 additions & 1 deletion util/crc32c_arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

#include "util/crc32c_arm64.h"

#if defined(__linux__) && defined(HAVE_ARM64_CRC)
#if defined(HAVE_ARM64_CRC)

#if defined(__linux__)
#include <asm/hwcap.h>
#endif
#ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT
#include <sys/auxv.h>
#endif
Expand Down

0 comments on commit ed1882e

Please sign in to comment.