summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/my_sys.h2
-rw-r--r--mysys/CMakeLists.txt2
-rw-r--r--mysys/checksum.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 31e202c5810..a344e88c093 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -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;
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index ecb4166802f..0572a3a2e28 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -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)
diff --git a/mysys/checksum.c b/mysys/checksum.c
index e86c2726722..948b9be6164 100644
--- a/mysys/checksum.c
+++ b/mysys/checksum.c
@@ -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,
@@ -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