From 796ba5ce697a2aada148f73d2f8faa1198b632f8 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 19 Dec 2021 16:48:25 +0800 Subject: [PATCH] bdev: guard bdev_module.h with extern "C" so the functions declared in this header file are not mangled by the C++ compiler when building, for instance, a bdev driver, implemented in C++. Signed-off-by: Kefu Chai Change-Id: I5a5d1abb06d0d3cd5f5d9245bb7c080f3874e83b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10745 Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot --- include/spdk/bdev_module.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/spdk/bdev_module.h b/include/spdk/bdev_module.h index ee9f6694b3..85d94aa7b2 100644 --- a/include/spdk/bdev_module.h +++ b/include/spdk/bdev_module.h @@ -52,6 +52,10 @@ #include "spdk/util.h" #include "spdk/uuid.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Block device module */ struct spdk_bdev_module { /** @@ -1290,4 +1294,8 @@ static void __attribute__((constructor)) _spdk_bdev_module_register_##name(void) #endif /* __SPDK_BDEV_MODULE_ONLY */ +#ifdef __cplusplus +} +#endif + #endif /* SPDK_BDEV_MODULE_H */