From 47f9cc0158920327ee5eb1a1a9b4318027dead0d Mon Sep 17 00:00:00 2001 From: Mitya Selivanov <0x7fffff@guattari.ru> Date: Sun, 7 Aug 2022 01:54:01 +0400 Subject: [msvc] Add extern C --- source/kit_test/test.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/kit_test') diff --git a/source/kit_test/test.h b/source/kit_test/test.h index 365c43c..bf1bf15 100644 --- a/source/kit_test/test.h +++ b/source/kit_test/test.h @@ -44,9 +44,15 @@ struct kit_tests_list { extern struct kit_tests_list kit_tests_list; #ifdef _MSC_VER +# ifdef __cplusplus +# define KIT_EXTERN_C_ extern "C" +# else +# define KIT_EXTERN_C_ +# endif + # pragma section(".CRT$XCU", read) # define KIT_TEST_ON_START_2_(f, p) \ - static void f(void); \ + KIT_EXTERN_C_ static void f(void); \ __declspec(allocate(".CRT$XCU")) void (*f##_)(void) = f; \ __pragma(comment(linker, "/include:" p #f "_")) static void f( \ void) -- cgit v1.2.3