From fb04611ff7521d09804b243d25a586ec49b5d26d Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 17 Oct 2024 10:42:55 +0200 Subject: [PATCH] crypto_backend.h: Wrap APIs in extern C It's a good practice to mark public APIs as extern "C" so that projects written in C++ can use our library. [mbroz] It is not public API in cryptsetup, but we use this backend in other projects, this aligns the code changes. Signed-off-by: Michal Privoznik --- lib/crypto_backend/crypto_backend.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/crypto_backend/crypto_backend.h b/lib/crypto_backend/crypto_backend.h index 948575ea..14af97d3 100644 --- a/lib/crypto_backend/crypto_backend.h +++ b/lib/crypto_backend/crypto_backend.h @@ -21,6 +21,10 @@ #define char16_t uint16_t #endif +# ifdef __cplusplus +extern "C" { +# endif + struct crypt_hash; struct crypt_hmac; struct crypt_cipher; @@ -143,4 +147,8 @@ int crypt_backend_memeq(const void *m1, const void *m2, size_t n); /* crypto backend running in FIPS mode */ bool crypt_fips_mode(void); +# ifdef __cplusplus +} +# endif + #endif /* _CRYPTO_BACKEND_H */