From 27e0c467aefb5b7591cb291e4456823966f58344 Mon Sep 17 00:00:00 2001 From: daanx Date: Wed, 25 Dec 2024 14:56:11 -0800 Subject: [PATCH] fix c++ initializer warning --- src/init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/init.c b/src/init.c index 81aca206..cc96e993 100644 --- a/src/init.c +++ b/src/init.c @@ -97,7 +97,12 @@ const mi_page_t _mi_page_empty = { // may lead to allocation itself on some platforms) // -------------------------------------------------------- -static mi_decl_cache_align mi_subproc_t subproc_main = { 0 }; // note: empty initializer to prevent running the constructor (in C++ compilation) +static mi_decl_cache_align mi_subproc_t subproc_main +#if __cplusplus += { }; // empty initializer to prevent running the constructor (with msvc) +#else += { 0 }; // C zero initialize +#endif static mi_decl_cache_align mi_tld_t tld_empty = { 0, // thread_id