From 60f09cd2b7913ae2f0807de03233d18a09876454 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 16 Dec 2015 11:12:05 +1100 Subject: [PATCH] MDEV-9288: portablity for compling on non-power platforms Also removed surperflous stdio include. --- storage/innobase/ut/crc32_power8/crc32.S | 5 +++++ storage/innobase/ut/crc32_power8/crc32_constants.h | 10 ++++++++++ storage/innobase/ut/crc32_power8/crc32_wrapper.c | 4 +++- storage/xtradb/ut/crc32_power8/crc32.S | 5 +++++ storage/xtradb/ut/crc32_power8/crc32_constants.h | 10 ++++++++++ storage/xtradb/ut/crc32_power8/crc32_wrapper.c | 4 +++- 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/storage/innobase/ut/crc32_power8/crc32.S b/storage/innobase/ut/crc32_power8/crc32.S index 136abe39836..52046bb9002 100644 --- a/storage/innobase/ut/crc32_power8/crc32.S +++ b/storage/innobase/ut/crc32_power8/crc32.S @@ -23,6 +23,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#ifdef __powerpc__ + #include #include "ppc-opcode.h" @@ -737,3 +740,5 @@ FUNC_START(__crc32_vpmsum) mr r3,r10 blr FUNC_END(__crc32_vpmsum) + +#endif /* __powerpc__ */ diff --git a/storage/innobase/ut/crc32_power8/crc32_constants.h b/storage/innobase/ut/crc32_power8/crc32_constants.h index 7a3a8dcd882..ba2592b829c 100644 --- a/storage/innobase/ut/crc32_power8/crc32_constants.h +++ b/storage/innobase/ut/crc32_power8/crc32_constants.h @@ -1,3 +1,9 @@ +#ifndef CRC32_CONSTANTS_H +#define CRC32_CONSTANTS_H + +#ifdef __powerpc__ + + #define CRC 0x1edc6f41 #define CRC_XOR #define REFLECT @@ -899,3 +905,7 @@ static const unsigned int crc_table[] = { /* 33 bit reflected Barrett constant n */ .octa 0x00000000000000000000000105ec76f1 #endif + +#endif /* __powerpc__ */ + +#endif diff --git a/storage/innobase/ut/crc32_power8/crc32_wrapper.c b/storage/innobase/ut/crc32_power8/crc32_wrapper.c index 6f9c7882a9d..d4c91371fa1 100644 --- a/storage/innobase/ut/crc32_power8/crc32_wrapper.c +++ b/storage/innobase/ut/crc32_power8/crc32_wrapper.c @@ -1,4 +1,4 @@ -#include +#ifdef __powerpc__ #define CRC_TABLE #include "crc32_constants.h" @@ -64,3 +64,5 @@ out: return crc; } + +#endif /* __powerpc__ */ diff --git a/storage/xtradb/ut/crc32_power8/crc32.S b/storage/xtradb/ut/crc32_power8/crc32.S index 136abe39836..52046bb9002 100644 --- a/storage/xtradb/ut/crc32_power8/crc32.S +++ b/storage/xtradb/ut/crc32_power8/crc32.S @@ -23,6 +23,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#ifdef __powerpc__ + #include #include "ppc-opcode.h" @@ -737,3 +740,5 @@ FUNC_START(__crc32_vpmsum) mr r3,r10 blr FUNC_END(__crc32_vpmsum) + +#endif /* __powerpc__ */ diff --git a/storage/xtradb/ut/crc32_power8/crc32_constants.h b/storage/xtradb/ut/crc32_power8/crc32_constants.h index 7a3a8dcd882..ba2592b829c 100644 --- a/storage/xtradb/ut/crc32_power8/crc32_constants.h +++ b/storage/xtradb/ut/crc32_power8/crc32_constants.h @@ -1,3 +1,9 @@ +#ifndef CRC32_CONSTANTS_H +#define CRC32_CONSTANTS_H + +#ifdef __powerpc__ + + #define CRC 0x1edc6f41 #define CRC_XOR #define REFLECT @@ -899,3 +905,7 @@ static const unsigned int crc_table[] = { /* 33 bit reflected Barrett constant n */ .octa 0x00000000000000000000000105ec76f1 #endif + +#endif /* __powerpc__ */ + +#endif diff --git a/storage/xtradb/ut/crc32_power8/crc32_wrapper.c b/storage/xtradb/ut/crc32_power8/crc32_wrapper.c index 6f9c7882a9d..d4c91371fa1 100644 --- a/storage/xtradb/ut/crc32_power8/crc32_wrapper.c +++ b/storage/xtradb/ut/crc32_power8/crc32_wrapper.c @@ -1,4 +1,4 @@ -#include +#ifdef __powerpc__ #define CRC_TABLE #include "crc32_constants.h" @@ -64,3 +64,5 @@ out: return crc; } + +#endif /* __powerpc__ */