Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions ext/standard/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ static inline int has_crc32_insn() {
# endif
}

# if defined(__GNUC__) && !defined(__clang__)
# pragma GCC push_options
# pragma GCC target ("+nothing+crc")
# if defined(__GNUC__)
# if!defined(__clang__)
# pragma GCC push_options
# pragma GCC target ("+nothing+crc")
# else
# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
# endif
# endif
static uint32_t crc32_aarch64(uint32_t crc, const char *p, size_t nr) {
while (nr >= sizeof(uint64_t)) {
Expand All @@ -84,8 +88,12 @@ static uint32_t crc32_aarch64(uint32_t crc, const char *p, size_t nr) {
}
return crc;
}
# if defined(__GNUC__) && !defined(__clang__)
# pragma GCC pop_options
# if defined(__GNUC__)
# if !defined(__clang__)
# pragma GCC pop_options
# else
# pragma clang attribute pop
# endif
# endif
#endif

Expand Down