From 1c66666a84093d228feba8095f1a6b5209a07be4 Mon Sep 17 00:00:00 2001 From: MiroKaku <50670906+MiroKaku@users.noreply.github.com> Date: Mon, 27 May 2024 14:35:29 +0800 Subject: [PATCH] fix: MSVC 1940 --- src/crt/stl/stdhndlr.cpp | 4 ++++ src/crt/stl/xlock.cpp | 4 ++++ src/ucxxrt.inl | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/src/crt/stl/stdhndlr.cpp b/src/crt/stl/stdhndlr.cpp index dc3fb8b..d278f37 100644 --- a/src/crt/stl/stdhndlr.cpp +++ b/src/crt/stl/stdhndlr.cpp @@ -5,6 +5,10 @@ #include +#ifndef _LOCK_MALLOC +#define _LOCK_MALLOC 1 +#endif + using new_hand = int(__cdecl*)(size_t); extern "C" new_hand __cdecl _set_new_handler(new_hand); diff --git a/src/crt/stl/xlock.cpp b/src/crt/stl/xlock.cpp index 09a1df9..69200b2 100644 --- a/src/crt/stl/xlock.cpp +++ b/src/crt/stl/xlock.cpp @@ -15,6 +15,10 @@ #endif #include "xmtx.hpp" +#ifndef _LOCK_AT_THREAD_EXIT +#define _LOCK_AT_THREAD_EXIT 4 +#endif + _STD_BEGIN constexpr int _Max_lock = 8; // must be power of two diff --git a/src/ucxxrt.inl b/src/ucxxrt.inl index 6578962..c30789c 100644 --- a/src/ucxxrt.inl +++ b/src/ucxxrt.inl @@ -94,6 +94,14 @@ # endif #endif +#ifndef _EXTERN_C +#define _EXTERN_C EXTERN_C_START +#endif + +#ifndef _END_EXTERN_C +#define _END_EXTERN_C EXTERN_C_END +#endif + #include #include #include