Skip to content

Commit

Permalink
make extern "C" functions explicitly noexcept (#4106)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
  • Loading branch information
CaseyCarter and StephanTLavavej authored Oct 25, 2023
1 parent 2e9c8a8 commit 0b9ec10
Show file tree
Hide file tree
Showing 58 changed files with 316 additions and 300 deletions.
2 changes: 1 addition & 1 deletion stl/inc/__msvc_sanitizer_annotate_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ extern const bool _Asan_string_should_annotate;
#if defined(_INSERT_VECTOR_ANNOTATION) || defined(_INSERT_STRING_ANNOTATION)
extern "C" {
void __cdecl __sanitizer_annotate_contiguous_container(
const void* _First, const void* _End, const void* _Old_last, const void* _New_last);
const void* _First, const void* _End, const void* _Old_last, const void* _New_last) noexcept;
}

#ifdef _M_ARM64EC
Expand Down
24 changes: 12 additions & 12 deletions stl/inc/experimental/coroutine
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ headers do not support Clang, but the C++20 <coroutine> header does.
#endif // defined(__cpp_impl_coroutine)

// intrinsics used in implementation of coroutine_handle
extern "C" size_t _coro_resume(void*);
extern "C" void _coro_destroy(void*);
extern "C" size_t _coro_done(void*);
extern "C" size_t _coro_resume(void*) noexcept;
extern "C" void _coro_destroy(void*) noexcept;
extern "C" size_t _coro_done(void*) noexcept;
#pragma intrinsic(_coro_resume)
#pragma intrinsic(_coro_destroy)
#pragma intrinsic(_coro_done)
Expand Down Expand Up @@ -262,15 +262,15 @@ _STD_END

// resumable functions support intrinsics

extern "C" size_t _coro_frame_size();
extern "C" void* _coro_frame_ptr();
extern "C" void _coro_init_block();
extern "C" void* _coro_resume_addr();
extern "C" void _coro_init_frame(void*);
extern "C" void _coro_save(size_t);
extern "C" void _coro_suspend(size_t);
extern "C" void _coro_cancel();
extern "C" void _coro_resume_block();
extern "C" size_t _coro_frame_size() noexcept;
extern "C" void* _coro_frame_ptr() noexcept;
extern "C" void _coro_init_block() noexcept;
extern "C" void* _coro_resume_addr() noexcept;
extern "C" void _coro_init_frame(void*) noexcept;
extern "C" void _coro_save(size_t) noexcept;
extern "C" void _coro_suspend(size_t) noexcept;
extern "C" void _coro_cancel() noexcept;
extern "C" void _coro_resume_block() noexcept;

#pragma intrinsic(_coro_frame_size)
#pragma intrinsic(_coro_frame_ptr)
Expand Down
59 changes: 30 additions & 29 deletions stl/inc/experimental/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -161,33 +161,34 @@ struct space_info { // space information for a file
};

// wide filenames
_FS_DLL void* __CLRCALL_PURE_OR_CDECL _Open_dir(wchar_t (&)[_MAX_FILESYS_NAME], const wchar_t*, int&, file_type&);
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Read_dir(wchar_t (&)[_MAX_FILESYS_NAME], void*, file_type&);
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Close_dir(void*);
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_get(wchar_t (&)[_MAX_FILESYS_NAME]);
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set(const wchar_t*);
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Symlink_get(wchar_t (&)[_MAX_FILESYS_NAME], const wchar_t*);
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Temp_get(wchar_t (&)[_MAX_FILESYS_NAME]);

_FS_DLL int __CLRCALL_PURE_OR_CDECL _Make_dir(const wchar_t*, const wchar_t*);
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Remove_dir(const wchar_t*);

_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t*, perms*);
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Lstat(const wchar_t*, perms*);
_FS_DLL uintmax_t __CLRCALL_PURE_OR_CDECL _File_size(const wchar_t*);
_FS_DLL uintmax_t __CLRCALL_PURE_OR_CDECL _Hard_links(const wchar_t*);
_FS_DLL int64_t __CLRCALL_PURE_OR_CDECL _Last_write_time(const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Set_last_write_time(const wchar_t*, int64_t);
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL _Statvfs(const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent(const wchar_t*, const wchar_t*);

_FS_DLL int __CLRCALL_PURE_OR_CDECL _Link(const wchar_t*, const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink(const wchar_t*, const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Rename(const wchar_t*, const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Resize(const wchar_t*, uintmax_t);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink(const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file(const wchar_t*, const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Chmod(const wchar_t*, perms);
_FS_DLL void* __CLRCALL_PURE_OR_CDECL _Open_dir(
wchar_t (&)[_MAX_FILESYS_NAME], const wchar_t*, int&, file_type&) noexcept;
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Read_dir(wchar_t (&)[_MAX_FILESYS_NAME], void*, file_type&) noexcept;
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Close_dir(void*) noexcept;
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_get(wchar_t (&)[_MAX_FILESYS_NAME]) noexcept;
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set(const wchar_t*) noexcept;
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Symlink_get(wchar_t (&)[_MAX_FILESYS_NAME], const wchar_t*) noexcept;
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Temp_get(wchar_t (&)[_MAX_FILESYS_NAME]) noexcept;

_FS_DLL int __CLRCALL_PURE_OR_CDECL _Make_dir(const wchar_t*, const wchar_t*) noexcept;
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Remove_dir(const wchar_t*) noexcept;

_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t*, perms*) noexcept;
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Lstat(const wchar_t*, perms*) noexcept;
_FS_DLL uintmax_t __CLRCALL_PURE_OR_CDECL _File_size(const wchar_t*) noexcept;
_FS_DLL uintmax_t __CLRCALL_PURE_OR_CDECL _Hard_links(const wchar_t*) noexcept;
_FS_DLL int64_t __CLRCALL_PURE_OR_CDECL _Last_write_time(const wchar_t*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Set_last_write_time(const wchar_t*, int64_t) noexcept;
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL _Statvfs(const wchar_t*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent(const wchar_t*, const wchar_t*) noexcept;

_FS_DLL int __CLRCALL_PURE_OR_CDECL _Link(const wchar_t*, const wchar_t*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink(const wchar_t*, const wchar_t*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Rename(const wchar_t*, const wchar_t*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Resize(const wchar_t*, uintmax_t) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink(const wchar_t*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file(const wchar_t*, const wchar_t*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Chmod(const wchar_t*, perms) noexcept;

template <class _Inchar, class _Outchar, class _Outtraits = char_traits<_Outchar>,
class _Outalloc = allocator<_Outchar>>
Expand Down Expand Up @@ -266,8 +267,8 @@ struct _Path_cvt<char32_t, char, _Outtraits,
}
};

_FS_DLL int __CLRCALL_PURE_OR_CDECL _To_byte(const wchar_t*, char*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _To_wide(const char*, wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _To_byte(const wchar_t*, char*) noexcept;
_FS_DLL int __CLRCALL_PURE_OR_CDECL _To_wide(const char*, wchar_t*) noexcept;

template <class _Outtraits, class _Outalloc>
struct _Path_cvt<char, wchar_t, _Outtraits,
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/memory
Original file line number Diff line number Diff line change
Expand Up @@ -3718,8 +3718,8 @@ _NODISCARD_ASSUME_ALIGNED constexpr _Ty* assume_aligned(_Ty* const _Ptr) noexcep
#endif // _HAS_CXX20

_EXTERN_C
_CRTIMP2_PURE void __cdecl _Lock_shared_ptr_spin_lock();
_CRTIMP2_PURE void __cdecl _Unlock_shared_ptr_spin_lock();
_CRTIMP2_PURE void __cdecl _Lock_shared_ptr_spin_lock() noexcept;
_CRTIMP2_PURE void __cdecl _Unlock_shared_ptr_spin_lock() noexcept;
_END_EXTERN_C

struct _Shared_ptr_spin_lock { // class to manage a spin lock for shared_ptr atomic operations
Expand Down
40 changes: 22 additions & 18 deletions stl/inc/xlocinfo
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,48 @@ _EXTERN_C_UNLESS_PURE
#define _M_MESSAGES _CATMASK(_X_MESSAGES)
#define _M_ALL (_CATMASK(_NCAT) - 1)

_CRTIMP2_PURE _Collvec __CLRCALL_PURE_OR_CDECL _Getcoll();
_CRTIMP2_PURE _Ctypevec __CLRCALL_PURE_OR_CDECL _Getctype();
_CRTIMP2_PURE _Cvtvec __CLRCALL_PURE_OR_CDECL _Getcvt();
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Getdateorder();
_CRTIMP2_PURE _Collvec __CLRCALL_PURE_OR_CDECL _Getcoll() noexcept;
_CRTIMP2_PURE _Ctypevec __CLRCALL_PURE_OR_CDECL _Getctype() noexcept;
_CRTIMP2_PURE _Cvtvec __CLRCALL_PURE_OR_CDECL _Getcvt() noexcept;
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Getdateorder() noexcept;

#ifdef _M_CEE_PURE
[System::Runtime::InteropServices::DllImport(_CRT_MSVCP_CURRENT, EntryPoint = "_Mbrtowc",
CallingConvention = System::Runtime::InteropServices::CallingConvention::Cdecl)] extern "C" int
_Mbrtowc(_Out_opt_ wchar_t*, const char*, size_t, mbstate_t*, const _Cvtvec*);
_Mbrtowc(_Out_opt_ wchar_t*, const char*, size_t, mbstate_t*, const _Cvtvec*) noexcept;

#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv
_MRTIMP2 _Success_(return >= 0) int __cdecl _Mbrtowc(
_When_(_Max_multibyte != 0, _Out_) wchar_t*, const char*, size_t _Max_multibyte, mbstate_t*, const _Cvtvec*);
_MRTIMP2 _Success_(return >= 0) int __cdecl _Mbrtowc(_When_(_Max_multibyte != 0, _Out_) wchar_t*, const char*,
size_t _Max_multibyte, mbstate_t*, const _Cvtvec*) noexcept;
#endif // ^^^ !defined(_M_CEE_PURE) ^^^

_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Strcoll(const char*, const char*, const char*, const char*, const _Collvec*);
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Strcoll(
const char*, const char*, const char*, const char*, const _Collvec*) noexcept;
_CRTIMP2_PURE size_t __CLRCALL_PURE_OR_CDECL _Strxfrm(_Out_writes_(_End1 - _String1)
_Post_readable_size_(return) char* _String1,
_In_z_ char* _End1, const char*, const char*, const _Collvec*);
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Tolower(int, const _Ctypevec*);
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Toupper(int, const _Ctypevec*);
_In_z_ char* _End1, const char*, const char*, const _Collvec*) noexcept;
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Tolower(int, const _Ctypevec*) noexcept;
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Toupper(int, const _Ctypevec*) noexcept;
_CRTIMP2_PURE _Success_(return != -1) int __CLRCALL_PURE_OR_CDECL
_Wcrtomb(_Out_ char*, wchar_t, mbstate_t*, const _Cvtvec*);
_Wcrtomb(_Out_ char*, wchar_t, mbstate_t*, const _Cvtvec*) noexcept;
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Wcscoll(
const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const _Collvec*);
const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const _Collvec*) noexcept;
_CRTIMP2_PURE size_t __CLRCALL_PURE_OR_CDECL _Wcsxfrm(_Out_writes_(_End1 - _String1) _Post_readable_size_(return)
wchar_t* _String1,
_In_z_ wchar_t* _End1, const wchar_t*, const wchar_t*, const _Collvec*);
_In_z_ wchar_t* _End1, const wchar_t*, const wchar_t*, const _Collvec*) noexcept;

_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Getwctype(wchar_t, const _Ctypevec*);
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Getwctype(wchar_t, const _Ctypevec*) noexcept;
_CRTIMP2_PURE const wchar_t* __CLRCALL_PURE_OR_CDECL _Getwctypes(
const wchar_t*, const wchar_t*, short*, const _Ctypevec*);
_CRTIMP2_PURE wchar_t __CLRCALL_PURE_OR_CDECL _Towlower(wchar_t, const _Ctypevec*);
_CRTIMP2_PURE wchar_t __CLRCALL_PURE_OR_CDECL _Towupper(wchar_t, const _Ctypevec*);
const wchar_t*, const wchar_t*, short*, const _Ctypevec*) noexcept;
_CRTIMP2_PURE wchar_t __CLRCALL_PURE_OR_CDECL _Towlower(wchar_t, const _Ctypevec*) noexcept;
_CRTIMP2_PURE wchar_t __CLRCALL_PURE_OR_CDECL _Towupper(wchar_t, const _Ctypevec*) noexcept;

_END_EXTERN_C_UNLESS_PURE

_EXTERN_C
// These _should_ be explicitly `noexcept` but cannot be made so here because
// the primary declarations in the C runtime headers are not.

_Success_(return != 0) _Ret_z_ _ACRTIMP char* __cdecl _Getdays();

_Success_(return != 0) _Ret_z_ _ACRTIMP char* __cdecl _Getmonths();
Expand Down
9 changes: 5 additions & 4 deletions stl/inc/xlocnum
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ _STL_DISABLE_CLANG_WARNINGS

_EXTERN_C_UNLESS_PURE

_CRTIMP2_PURE long __CLRCALL_PURE_OR_CDECL _Stolx(const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*);
_CRTIMP2_PURE long __CLRCALL_PURE_OR_CDECL _Stolx(
const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*) noexcept;
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(
const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*);
const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*) noexcept;
_CRTIMP2_PURE long long __CLRCALL_PURE_OR_CDECL _Stollx(
const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*);
const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*) noexcept;
_CRTIMP2_PURE unsigned long long __CLRCALL_PURE_OR_CDECL _Stoullx(
const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*);
const char*, _Out_opt_ _Deref_post_opt_valid_ char**, int, int*) noexcept;

_END_EXTERN_C_UNLESS_PURE

Expand Down
60 changes: 30 additions & 30 deletions stl/inc/xthreads.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ using _Cnd_t = _Cnd_internal_imp_t*;
enum class _Thrd_result : int { _Success, _Nomem, _Timedout, _Busy, _Error };

// threads
_CRTIMP2_PURE _Thrd_result __cdecl _Thrd_detach(_Thrd_t);
_CRTIMP2_PURE _Thrd_result __cdecl _Thrd_join(_Thrd_t, int*);
_CRTIMP2_PURE void __cdecl _Thrd_yield();
_CRTIMP2_PURE unsigned int __cdecl _Thrd_hardware_concurrency();
_CRTIMP2_PURE _Thrd_id_t __cdecl _Thrd_id();
_CRTIMP2_PURE _Thrd_result __cdecl _Thrd_detach(_Thrd_t) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Thrd_join(_Thrd_t, int*) noexcept;
_CRTIMP2_PURE void __cdecl _Thrd_yield() noexcept;
_CRTIMP2_PURE unsigned int __cdecl _Thrd_hardware_concurrency() noexcept;
_CRTIMP2_PURE _Thrd_id_t __cdecl _Thrd_id() noexcept;
void __stdcall _Thrd_sleep_for(unsigned long /*ms*/) noexcept;

// mutexes
Expand All @@ -97,39 +97,39 @@ enum { // mutex types
};

#ifdef _CRTBLD
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t*, int);
_CRTIMP2_PURE void __cdecl _Mtx_destroy(_Mtx_t);
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t*, int) noexcept;
_CRTIMP2_PURE void __cdecl _Mtx_destroy(_Mtx_t) noexcept;
#endif // _CRTBLD
_CRTIMP2_PURE void __cdecl _Mtx_init_in_situ(_Mtx_t, int);
_CRTIMP2_PURE void __cdecl _Mtx_destroy_in_situ(_Mtx_t);
_CRTIMP2_PURE int __cdecl _Mtx_current_owns(_Mtx_t);
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_lock(_Mtx_t);
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_trylock(_Mtx_t);
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_unlock(_Mtx_t); // TRANSITION, ABI: Always succeeds
_CRTIMP2_PURE void __cdecl _Mtx_init_in_situ(_Mtx_t, int) noexcept;
_CRTIMP2_PURE void __cdecl _Mtx_destroy_in_situ(_Mtx_t) noexcept;
_CRTIMP2_PURE int __cdecl _Mtx_current_owns(_Mtx_t) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_lock(_Mtx_t) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_trylock(_Mtx_t) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_unlock(_Mtx_t) noexcept; // TRANSITION, ABI: Always succeeds

// shared mutex
// these declarations must be in sync with those in sharedmutex.cpp
void __cdecl _Smtx_lock_exclusive(_Smtx_t*);
void __cdecl _Smtx_lock_shared(_Smtx_t*);
int __cdecl _Smtx_try_lock_exclusive(_Smtx_t*);
int __cdecl _Smtx_try_lock_shared(_Smtx_t*);
void __cdecl _Smtx_unlock_exclusive(_Smtx_t*);
void __cdecl _Smtx_unlock_shared(_Smtx_t*);
void __cdecl _Smtx_lock_exclusive(_Smtx_t*) noexcept;
void __cdecl _Smtx_lock_shared(_Smtx_t*) noexcept;
int __cdecl _Smtx_try_lock_exclusive(_Smtx_t*) noexcept;
int __cdecl _Smtx_try_lock_shared(_Smtx_t*) noexcept;
void __cdecl _Smtx_unlock_exclusive(_Smtx_t*) noexcept;
void __cdecl _Smtx_unlock_shared(_Smtx_t*) noexcept;

// condition variables
#ifdef _CRTBLD
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_init(_Cnd_t*);
_CRTIMP2_PURE void __cdecl _Cnd_destroy(_Cnd_t);
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_init(_Cnd_t*) noexcept;
_CRTIMP2_PURE void __cdecl _Cnd_destroy(_Cnd_t) noexcept;
#endif // _CRTBLD
_CRTIMP2_PURE void __cdecl _Cnd_init_in_situ(_Cnd_t);
_CRTIMP2_PURE void __cdecl _Cnd_destroy_in_situ(_Cnd_t);
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_wait(_Cnd_t, _Mtx_t); // TRANSITION, ABI: Always succeeds
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_timedwait(_Cnd_t, _Mtx_t, const _timespec64*);
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_broadcast(_Cnd_t); // TRANSITION, ABI: Always succeeds
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_signal(_Cnd_t); // TRANSITION, ABI: Always succeeds
_CRTIMP2_PURE void __cdecl _Cnd_register_at_thread_exit(_Cnd_t, _Mtx_t, int*);
_CRTIMP2_PURE void __cdecl _Cnd_unregister_at_thread_exit(_Mtx_t);
_CRTIMP2_PURE void __cdecl _Cnd_do_broadcast_at_thread_exit();
_CRTIMP2_PURE void __cdecl _Cnd_init_in_situ(_Cnd_t) noexcept;
_CRTIMP2_PURE void __cdecl _Cnd_destroy_in_situ(_Cnd_t) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_wait(_Cnd_t, _Mtx_t) noexcept; // TRANSITION, ABI: Always succeeds
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_timedwait(_Cnd_t, _Mtx_t, const _timespec64*) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_broadcast(_Cnd_t) noexcept; // TRANSITION, ABI: Always succeeds
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_signal(_Cnd_t) noexcept; // TRANSITION, ABI: Always succeeds
_CRTIMP2_PURE void __cdecl _Cnd_register_at_thread_exit(_Cnd_t, _Mtx_t, int*) noexcept;
_CRTIMP2_PURE void __cdecl _Cnd_unregister_at_thread_exit(_Mtx_t) noexcept;
_CRTIMP2_PURE void __cdecl _Cnd_do_broadcast_at_thread_exit() noexcept;
_END_EXTERN_C

_STD_BEGIN
Expand Down
10 changes: 5 additions & 5 deletions stl/inc/xtimec.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ _STL_DISABLE_CLANG_WARNINGS
_EXTERN_C

#ifdef _CRTBLD
_CRTIMP2_PURE long __cdecl _Xtime_diff_to_millis2(const _timespec64*, const _timespec64*);
_CRTIMP2_PURE long __cdecl _Xtime_diff_to_millis2(const _timespec64*, const _timespec64*) noexcept;
#endif // _CRTBLD

_CRTIMP2_PURE long long __cdecl _Xtime_get_ticks();
_CRTIMP2_PURE long long __cdecl _Xtime_get_ticks() noexcept;

#ifdef _CRTBLD
// Used by several src files, but not dllexported.
void _Timespec64_get_sys(_timespec64*);
void _Timespec64_get_sys(_timespec64*) noexcept;
#endif // defined(_CRTBLD)

_CRTIMP2_PURE long long __cdecl _Query_perf_counter();
_CRTIMP2_PURE long long __cdecl _Query_perf_frequency();
_CRTIMP2_PURE long long __cdecl _Query_perf_counter() noexcept;
_CRTIMP2_PURE long long __cdecl _Query_perf_frequency() noexcept;

_END_EXTERN_C

Expand Down
2 changes: 1 addition & 1 deletion stl/src/StlCompareStringA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Failure: 0
extern "C" _CRTIMP2 int __cdecl __crtCompareStringA(_In_z_ LPCWSTR LocaleName, _In_ DWORD dwCmpFlags,
_In_reads_(cchCount1) LPCSTR lpString1, _In_ int cchCount1, _In_reads_(cchCount2) LPCSTR lpString2,
_In_ int cchCount2, _In_ int code_page) {
_In_ int cchCount2, _In_ int code_page) noexcept {
// CompareString will compare past null terminator. Must find null terminator if in string before cchCountn chars.
if (cchCount1 > 0) {
cchCount1 = static_cast<int>(__strncnt(lpString1, cchCount1));
Expand Down
2 changes: 1 addition & 1 deletion stl/src/StlCompareStringW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// Failure: 0
extern "C" _CRTIMP2 int __cdecl __crtCompareStringW(_In_z_ LPCWSTR LocaleName, _In_ DWORD dwCmpFlags,
_In_reads_(cchCount1) LPCWSTR lpString1, _In_ int cchCount1, _In_reads_(cchCount2) LPCWSTR lpString2,
_In_ int cchCount2) {
_In_ int cchCount2) noexcept {
// CompareString will compare past null terminator. Must find null terminator if in string before cchCountn wide
// characters.
if (cchCount1 > 0) {
Expand Down
2 changes: 1 addition & 1 deletion stl/src/StlLCMapStringA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// Failure: 0
extern "C" _CRTIMP2 int __cdecl __crtLCMapStringA(_In_opt_z_ LPCWSTR LocaleName, _In_ DWORD dwMapFlags,
_In_reads_(cchSrc) LPCSTR lpSrcStr, _In_ int cchSrc, _Out_writes_opt_(cchDest) char* lpDestStr, _In_ int cchDest,
_In_ int code_page, _In_ BOOL bError) {
_In_ int code_page, _In_ BOOL bError) noexcept {
// LCMapString will map past the null terminator. We must find the null
// terminator if it occurs in the string before cchSrc characters
// and cap the number of characters to be considered.
Expand Down
2 changes: 1 addition & 1 deletion stl/src/StlLCMapStringW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Failure: 0
extern "C" _CRTIMP2 int __cdecl __crtLCMapStringW(_In_opt_z_ LPCWSTR const locale_name, _In_ DWORD const map_flags,
_In_reads_(source_count) LPCWSTR const source, _In_ int source_count,
_Out_writes_opt_(destination_count) wchar_t* const destination, _In_ int const destination_count) {
_Out_writes_opt_(destination_count) wchar_t* const destination, _In_ int const destination_count) noexcept {
// LCMapString will map past the null terminator. We must find the null terminator if it occurs in the string
// before source_count characters and cap the number of characters to be considered.
if (source_count > 0) {
Expand Down
Loading

0 comments on commit 0b9ec10

Please sign in to comment.