diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index 602ce3eeb6e2b..d9a4a00d9caef 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -68,6 +68,8 @@ static inline int has_crc32_insn(void) { # if!defined(__clang__) # pragma GCC push_options # pragma GCC target ("+nothing+crc") +# elif defined(__APPLE__) +# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function) # else # pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function) # endif @@ -96,6 +98,8 @@ static uint32_t crc32_aarch64(uint32_t crc, const char *p, size_t nr) { # if defined(__GNUC__) # if !defined(__clang__) # pragma GCC pop_options +# elif defined(__APPLE__) +# pragma clang attribute pop # else # pragma clang attribute pop # endif