Skip to content

Commit dbd58d7

Browse files
committed
[UCRT] Fix GCC/Clang compilation of template specializations
1 parent c15b618 commit dbd58d7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

sdk/lib/ucrt/inc/corecrt_internal_traits.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,41 @@
1717

1818
#pragma pack(push, _CRT_PACKING)
1919

20+
#if defined(__GNUC__) || defined(__clang__)
21+
// We have to declare them here, because GCC expects them to be declared,
22+
// when the template specializations below are instanciated!
23+
#include <corecrt_io.h>
24+
extern "C" {
25+
errno_t __cdecl _access_s(char const* const path, int const access_mode);
26+
errno_t __cdecl _waccess_s(wchar_t const* const path, int const access_mode);
27+
__time32_t __cdecl __loctotime32_t(int, int, int, int, int, int, int);
28+
__time64_t __cdecl __loctotime64_t(int, int, int, int, int, int, int);
29+
_Check_return_opt_ long __cdecl _lseek_nolock(_In_ int _FileHandle, _In_ long _Offset, _In_ int _Origin);
30+
_Check_return_opt_ __int64 __cdecl _lseeki64_nolock(_In_ int _FileHandle, _In_ __int64 _Offset, _In_ int _Origin);
31+
_ACRTIMP __time32_t __cdecl _time32(_Out_opt_ __time32_t* _Time);
32+
_ACRTIMP __time64_t __cdecl _time64(_Out_opt_ __time64_t* _Time);
33+
_Success_(return == 0)
34+
errno_t __cdecl _sopen_nolock(
35+
_Out_ int* _UnlockFlag,
36+
_Out_ int* _FileHandle,
37+
_In_z_ char const* _FileName,
38+
_In_ int _OpenFlag,
39+
_In_ int _ShareFlag,
40+
_In_ int _PermissionFlag,
41+
_In_ int _SecureFlag
42+
);
43+
_Success_(return == 0)
44+
errno_t __cdecl _wsopen_nolock(
45+
_Out_ int* _UnlockFlag,
46+
_Out_ int* _FileHandle,
47+
_In_z_ wchar_t const* _FileName,
48+
_In_ int _OpenFlag,
49+
_In_ int _ShareFlag,
50+
_In_ int _PermissionFlag,
51+
_In_ int _SecureFlag
52+
);
53+
} // extern "C"
54+
#endif // __GNUC__
2055

2156

2257
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

0 commit comments

Comments
 (0)