mirror of
https://github.com/Tencent/MMKV.git
synced 2026-10-17 04:30:56 +08:00
fix Xcode mysterious build error
This commit is contained in:
+1
-1
@@ -91,7 +91,7 @@ void MMKV::minimalInit(MMKVPath_t defaultRootDir) {
|
||||
// crc32 instruction requires A10 chip, aka iPhone 7 or iPad 6th generation
|
||||
int device = 0, version = 0;
|
||||
GetAppleMachineInfo(device, version);
|
||||
# ifdef __aarch64__
|
||||
# ifdef MMKV_USE_ARMV8_CRC32
|
||||
if ((device == iPhone && version >= 9) || (device == iPad && version >= 7)) {
|
||||
CRC32 = mmkv::armv8_crc32;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef CHECKSUM_H
|
||||
#define CHECKSUM_H
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "../MMKVPredef.h"
|
||||
@@ -39,6 +40,8 @@ uLong crc32(uLong crc, const Bytef *buf, z_size_t len);
|
||||
|
||||
# ifdef __aarch64__
|
||||
|
||||
# define MMKV_USE_ARMV8_CRC32
|
||||
|
||||
namespace mmkv {
|
||||
uint32_t armv8_crc32(uint32_t crc, const uint8_t *buf, size_t len);
|
||||
}
|
||||
@@ -57,4 +60,5 @@ extern CRC32_Func_t CRC32;
|
||||
|
||||
#endif // MMKV_EMBED_ZLIB
|
||||
|
||||
#endif
|
||||
#endif // __cplusplus
|
||||
#endif // CHECKSUM_H
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "Checksum.h"
|
||||
|
||||
#ifdef __aarch64__
|
||||
#ifdef MMKV_USE_ARMV8_CRC32
|
||||
|
||||
# include <zlib.h>
|
||||
|
||||
@@ -110,4 +110,4 @@ TARGET_ARM_CRC uint32_t armv8_crc32(uint32_t crc, const uint8_t *buf, size_t len
|
||||
|
||||
} // namespace mmkv
|
||||
|
||||
#endif // __aarch64__
|
||||
#endif // MMKV_USE_ARMV8_CRC32
|
||||
|
||||
Reference in New Issue
Block a user