From 256a3a814f57d5eaf9a3dfca17a9ef8ee89d6925 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Mon, 19 Oct 2026 13:26:31 +0100 Subject: [PATCH] Give the empty-PIN cache test hook C linkage tests/empty_pin_cache_test.c declared WP11_Test_SetEmptyPinCheckHook without extern "C", so the C++ debug build (cpp_debug_build) could not link the test. Wrap it like the other test hook declarations. --- tests/empty_pin_cache_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/empty_pin_cache_test.c b/tests/empty_pin_cache_test.c index 51db8f55..dbd8c3dd 100644 --- a/tests/empty_pin_cache_test.c +++ b/tests/empty_pin_cache_test.c @@ -63,7 +63,13 @@ !defined(WOLFPKCS11_LEGACY_PRIVATE_FALSE_DEFAULT) /* DEBUG_WOLFPKCS11-only test hook exported by libwolfpkcs11. */ +#ifdef __cplusplus +extern "C" { +#endif extern void WP11_Test_SetEmptyPinCheckHook(void (*hook)(void)); +#ifdef __cplusplus +} +#endif #define EMPTY_PIN_CACHE_TEST_DIR "./store/empty_pin_cache_test" #define WOLFPKCS11_TOKEN_FILENAME "wp11_token_0000000000000001"