From fade39776327ce99c2ffc980d345397f39b4f328 Mon Sep 17 00:00:00 2001 From: Brian Michel Date: Fri, 20 Oct 2023 03:05:48 -0400 Subject: [PATCH] Add extern C markers (#204) * Add extern C markers * Only add extern in header file. --- .gitignore | 1 + .../CCryptoBoringSSLShims/include/CCryptoBoringSSLShims.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index e7b47788..9b3fae34 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ DerivedData .*.sw[nop] +.vscode diff --git a/Sources/CCryptoBoringSSLShims/include/CCryptoBoringSSLShims.h b/Sources/CCryptoBoringSSLShims/include/CCryptoBoringSSLShims.h index d8a737f9..4ef86401 100644 --- a/Sources/CCryptoBoringSSLShims/include/CCryptoBoringSSLShims.h +++ b/Sources/CCryptoBoringSSLShims/include/CCryptoBoringSSLShims.h @@ -22,6 +22,10 @@ #include #endif +#if defined(__cplusplus) +extern "C" { +#endif + // MARK:- Pointer type shims // This section of the code handles shims that change uint8_t* pointers to // void *s. This is done because Swift does not have the rule that C does, that @@ -120,4 +124,8 @@ int CCryptoBoringSSLShims_RSA_public_encrypt(int flen, const void *from, void *t int CCryptoBoringSSLShims_RSA_private_decrypt(int flen, const void *from, void *to, RSA *rsa, int padding); +#if defined(__cplusplus) +} +#endif // defined(__cplusplus) + #endif // C_CRYPTO_BORINGSSL_SHIMS_H