Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
fix: build error(msvc 19.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku committed Jun 1, 2023
1 parent 1321885 commit 9ea19d3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions msvc/ucxxrt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\crt\stl\init_locks.hpp" />
<ClInclude Include="..\src\crt\stl\primitives.hpp" />
<ClInclude Include="..\src\crt\stl\xmath.hpp" />
<ClInclude Include="..\src\crt\stl\xmtx.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions msvc/ucxxrt.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
<ClInclude Include="..\src\crt\stl\xmtx.hpp">
<Filter>ucxxrt\crt\stl</Filter>
</ClInclude>
<ClInclude Include="..\src\crt\stl\init_locks.hpp">
<Filter>ucxxrt\crt\stl</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\src\ucxxrt.inl">
Expand Down
31 changes: 31 additions & 0 deletions src/crt/stl/init_locks.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#pragma once

#include <yvals.h>

_STD_BEGIN

class _CRTIMP2_PURE_IMPORT _Init_locks { // initialize mutexes
public:
#ifdef _M_CEE_PURE
__CLR_OR_THIS_CALL _Init_locks() noexcept {
_Init_locks_ctor(this);
}

__CLR_OR_THIS_CALL ~_Init_locks() noexcept {
_Init_locks_dtor(this);
}

#else // _M_CEE_PURE
__thiscall _Init_locks() noexcept;
__thiscall ~_Init_locks() noexcept;
#endif // _M_CEE_PURE

private:
static void __cdecl _Init_locks_ctor(_Init_locks*) noexcept;
static void __cdecl _Init_locks_dtor(_Init_locks*) noexcept;
};

_STD_END
3 changes: 3 additions & 0 deletions src/crt/stl/xlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <clocale>
#include <cstdlib>

#if _MSC_VER >= 1936 // 17.6
#include "init_locks.hpp"
#endif
#include "xmtx.hpp"

_STD_BEGIN
Expand Down

0 comments on commit 9ea19d3

Please sign in to comment.