From dd259b3169fc362d8d23fa1535c4be377c1fe82e Mon Sep 17 00:00:00 2001 From: guoling Date: Tue, 24 Mar 2020 20:57:23 +0800 Subject: [PATCH] add cplusplus check --- Core/CodedInputData.h | 2 ++ Core/CodedOutputData.h | 2 ++ Core/InterProcessLock.h | 2 ++ Core/MMKVMetaInfo.hpp | 2 ++ Core/MemoryFile.h | 2 ++ Core/MiniPBCoder.h | 2 ++ Core/PBEncodeItem.hpp | 2 ++ Core/aes/AESCrypt.h | 2 ++ Core/aes/openssl/openssl_aes.h | 2 ++ Core/aes/openssl/openssl_aes_locl.h | 2 ++ Core/aes/openssl/openssl_md5_locl.h | 3 +++ Core/crc32/Checksum.h | 4 ++++ 12 files changed, 27 insertions(+) diff --git a/Core/CodedInputData.h b/Core/CodedInputData.h index 0fbe5dc3..9811edfe 100644 --- a/Core/CodedInputData.h +++ b/Core/CodedInputData.h @@ -20,6 +20,7 @@ #ifndef MMKV_CODEDINPUTDATA_H #define MMKV_CODEDINPUTDATA_H +#ifdef __cplusplus #include "MMKVPredef.h" @@ -75,4 +76,5 @@ public: } // namespace mmkv +#endif #endif //MMKV_CODEDINPUTDATA_H diff --git a/Core/CodedOutputData.h b/Core/CodedOutputData.h index a1207bd4..ac988ee9 100644 --- a/Core/CodedOutputData.h +++ b/Core/CodedOutputData.h @@ -20,6 +20,7 @@ #ifndef MMKV_CODEDOUTPUTDATA_H #define MMKV_CODEDOUTPUTDATA_H +#ifdef __cplusplus #include "MMKVPredef.h" @@ -80,4 +81,5 @@ public: } // namespace mmkv +#endif #endif //MMKV_CODEDOUTPUTDATA_H diff --git a/Core/InterProcessLock.h b/Core/InterProcessLock.h index dc70f190..8e479f97 100644 --- a/Core/InterProcessLock.h +++ b/Core/InterProcessLock.h @@ -20,6 +20,7 @@ #ifndef MMKV_INTERPROCESSLOCK_H #define MMKV_INTERPROCESSLOCK_H +#ifdef __cplusplus #include "MMKVPredef.h" @@ -114,4 +115,5 @@ public: } // namespace mmkv +#endif #endif //MMKV_INTERPROCESSLOCK_H diff --git a/Core/MMKVMetaInfo.hpp b/Core/MMKVMetaInfo.hpp index 4ab8a991..8878bf1a 100755 --- a/Core/MMKVMetaInfo.hpp +++ b/Core/MMKVMetaInfo.hpp @@ -20,6 +20,7 @@ #ifndef MMKV_MMKVMETAINFO_H #define MMKV_MMKVMETAINFO_H +#ifdef __cplusplus #include "aes/AESCrypt.h" #include @@ -76,4 +77,5 @@ static_assert(sizeof(MMKVMetaInfo) <= (4 * 1024), "MMKVMetaInfo lager than one p } // namespace mmkv +#endif #endif //MMKV_MMKVMETAINFO_H diff --git a/Core/MemoryFile.h b/Core/MemoryFile.h index d136ef83..05cbcf06 100644 --- a/Core/MemoryFile.h +++ b/Core/MemoryFile.h @@ -20,6 +20,7 @@ #ifndef MMKV_MAMERYFILE_H #define MMKV_MAMERYFILE_H +#ifdef __cplusplus #include "MMKVPredef.h" @@ -103,4 +104,5 @@ extern bool zeroFillFile(MMKVFileHandle_t fd, size_t startPos, size_t size); extern size_t getPageSize(); } // namespace mmkv +#endif #endif //MMKV_MAMERYFILE_H diff --git a/Core/MiniPBCoder.h b/Core/MiniPBCoder.h index a6113899..d79640cf 100644 --- a/Core/MiniPBCoder.h +++ b/Core/MiniPBCoder.h @@ -20,6 +20,7 @@ #ifndef MMKV_MINIPBCODER_H #define MMKV_MINIPBCODER_H +#ifdef __cplusplus #include "MMKVPredef.h" @@ -113,4 +114,5 @@ public: } // namespace mmkv +#endif #endif //MMKV_MINIPBCODER_H diff --git a/Core/PBEncodeItem.hpp b/Core/PBEncodeItem.hpp index 4a5ac253..7cd232c6 100644 --- a/Core/PBEncodeItem.hpp +++ b/Core/PBEncodeItem.hpp @@ -20,6 +20,7 @@ #ifndef MMKV_PBENCODEITEM_HPP #define MMKV_PBENCODEITEM_HPP +#ifdef __cplusplus #include "MMKVPredef.h" @@ -114,4 +115,5 @@ struct PBEncodeItem { } // namespace mmkv +#endif #endif //MMKV_PBENCODEITEM_HPP diff --git a/Core/aes/AESCrypt.h b/Core/aes/AESCrypt.h index a89f0dc7..fc2e6e8a 100644 --- a/Core/aes/AESCrypt.h +++ b/Core/aes/AESCrypt.h @@ -20,6 +20,7 @@ #ifndef AES_CRYPT_H_ #define AES_CRYPT_H_ +#ifdef __cplusplus #include @@ -71,4 +72,5 @@ void testAESCrypt(); } // namespace mmkv +#endif #endif /* AES_CRYPT_H_ */ diff --git a/Core/aes/openssl/openssl_aes.h b/Core/aes/openssl/openssl_aes.h index 9412cc03..fc2686d7 100644 --- a/Core/aes/openssl/openssl_aes.h +++ b/Core/aes/openssl/openssl_aes.h @@ -9,6 +9,7 @@ #ifndef HEADER_AES_H # define HEADER_AES_H +#ifdef __cplusplus #include "openssl_opensslconf.h" #include "openssl_arm_arch.h" @@ -101,3 +102,4 @@ void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key #endif // __ARM_MAX_ARCH__ > 0 #endif +#endif diff --git a/Core/aes/openssl/openssl_aes_locl.h b/Core/aes/openssl/openssl_aes_locl.h index a5b368f3..2fa1cd45 100644 --- a/Core/aes/openssl/openssl_aes_locl.h +++ b/Core/aes/openssl/openssl_aes_locl.h @@ -9,6 +9,7 @@ #ifndef HEADER_AES_LOCL_H # define HEADER_AES_LOCL_H +#ifdef __cplusplus # include "openssl_opensslconf.h" # include @@ -33,4 +34,5 @@ typedef unsigned int u32; typedef unsigned short u16; typedef unsigned char u8; +#endif #endif /* !HEADER_AES_LOCL_H */ diff --git a/Core/aes/openssl/openssl_md5_locl.h b/Core/aes/openssl/openssl_md5_locl.h index 73f7fc11..a528d954 100755 --- a/Core/aes/openssl/openssl_md5_locl.h +++ b/Core/aes/openssl/openssl_md5_locl.h @@ -6,6 +6,7 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +#ifdef __cplusplus #include #include @@ -70,3 +71,5 @@ void md5_block_data_order(MD5_CTX *c, const void *p, size_t num); a+=b; }; } // namespace openssl + +#endif diff --git a/Core/crc32/Checksum.h b/Core/crc32/Checksum.h index 5ecaff8d..4763a804 100644 --- a/Core/crc32/Checksum.h +++ b/Core/crc32/Checksum.h @@ -19,6 +19,8 @@ */ #pragma once +#ifdef __cplusplus + #include "../MMKVPredef.h" #if MMKV_EMBED_ZLIB @@ -61,3 +63,5 @@ extern CRC32_Func_t CRC32; # endif // __aarch64__ #endif // MMKV_EMBED_ZLIB + +#endif