Skip to content

Commit

Permalink
MDEV-22641: postfix - crc32{,c} fixups for ppc64
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Jun 3, 2020
1 parent 701efbb commit 463a8fc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/my_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ extern int unpackfrm(uchar **, size_t *, const uchar *);

void my_checksum_init(void);
#ifdef HAVE_CRC32_VPMSUM
extern my_checksum(ha_checksum, const void *, size_t);
extern ha_checksum my_checksum(ha_checksum, const void *, size_t);
#else
typedef ha_checksum (*my_crc32_t)(ha_checksum, const void *, size_t);
extern MYSQL_PLUGIN_IMPORT my_crc32_t my_checksum;
Expand Down
2 changes: 1 addition & 1 deletion mysys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
ENDIF()
ENDIF()
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
SET(HAVE_CRC32_VPMSUM 1)
SET(HAVE_CRC32_VPMSUM 1 PARENT_SCOPE)
SET(MYSYS_SOURCES ${MYSYS_SOURCES} $<TARGET_OBJECTS:crc32c> $<TARGET_OBJECTS:crc32ieee>)

ADD_LIBRARY(crc32c OBJECT crc32/crc32_ppc64.c)
Expand Down
2 changes: 1 addition & 1 deletion mysys/checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <my_sys.h>
#include <zlib.h>

#if !defined(HAVE_CRC32_VPMSUM)
/* TODO: remove this once zlib adds inherent support for hardware accelerated
crc32 for all architectures. */
static unsigned int my_crc32_zlib(unsigned int crc, const void *data,
Expand All @@ -26,7 +27,6 @@ static unsigned int my_crc32_zlib(unsigned int crc, const void *data,
return (unsigned int) crc32(crc, data, (unsigned int) len);
}

#if !defined(HAVE_CRC32_VPMSUM)
my_crc32_t my_checksum= my_crc32_zlib;
#endif

Expand Down

0 comments on commit 463a8fc

Please sign in to comment.