Skip to content

Commit

Permalink
Minor modules modifications (#3373)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Feb 3, 2023
1 parent c1c1be4 commit 9c988d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
22 changes: 11 additions & 11 deletions stl/inc/ctime
Original file line number Diff line number Diff line change
Expand Up @@ -30,46 +30,46 @@ _EXPORT_STD using _CSTD strftime;
_EXPORT_STD using _CSTD timespec;
#endif // _HAS_CXX17

#if _HAS_CXX23 && defined(_BUILD_STD_MODULE) // TRANSITION, DevCom-1126857
#if _HAS_CXX23 && defined(_BUILD_STD_MODULE) // TRANSITION, OS-33790456
_STL_DISABLE_DEPRECATED_WARNING

// These workaround functions intentionally aren't inline.
_EXPORT_STD
_Check_return_ _CRT_INSECURE_DEPRECATE(ctime_s)
char* __CRTDECL ctime(_In_ const time_t* const _Time) noexcept /* strengthened */ {
_Check_return_ _CRT_INSECURE_DEPRECATE(ctime_s) inline char* __CRTDECL ctime(_In_ const time_t* const _Time) noexcept
/* strengthened */ {
return _CSTD _ctime64(_Time);
}

_EXPORT_STD
_Check_return_ double __CRTDECL difftime(_In_ const time_t _Time1, _In_ const time_t _Time2) noexcept
_Check_return_ inline double __CRTDECL difftime(_In_ const time_t _Time1, _In_ const time_t _Time2) noexcept
/* strengthened */ {
return _CSTD _difftime64(_Time1, _Time2);
}

_EXPORT_STD
_Check_return_ _CRT_INSECURE_DEPRECATE(gmtime_s)
tm* __CRTDECL gmtime(_In_ const time_t* const _Time) noexcept /* strengthened */ {
_Check_return_ _CRT_INSECURE_DEPRECATE(gmtime_s) inline tm* __CRTDECL gmtime(_In_ const time_t* const _Time) noexcept
/* strengthened */ {
return _CSTD _gmtime64(_Time);
}

_EXPORT_STD
_CRT_INSECURE_DEPRECATE(localtime_s)
tm* __CRTDECL localtime(_In_ const time_t* const _Time) noexcept /* strengthened */ {
inline tm* __CRTDECL localtime(_In_ const time_t* const _Time) noexcept /* strengthened */ {
return _CSTD _localtime64(_Time);
}

_EXPORT_STD
_Check_return_opt_ time_t __CRTDECL mktime(_Inout_ tm* const _Tm) noexcept /* strengthened */ {
_Check_return_opt_ inline time_t __CRTDECL mktime(_Inout_ tm* const _Tm) noexcept /* strengthened */ {
return _CSTD _mktime64(_Tm);
}

_EXPORT_STD
time_t __CRTDECL time(_Out_opt_ time_t* const _Time) noexcept /* strengthened */ {
inline time_t __CRTDECL time(_Out_opt_ time_t* const _Time) noexcept /* strengthened */ {
return _CSTD _time64(_Time);
}

_EXPORT_STD
_Check_return_ int __CRTDECL timespec_get(_Out_ timespec* const _Ts, _In_ const int _Base) noexcept /* strengthened */ {
_Check_return_ inline int __CRTDECL timespec_get(_Out_ timespec* const _Ts, _In_ const int _Base) noexcept
/* strengthened */ {
return _CSTD _timespec64_get(reinterpret_cast<_timespec64*>(_Ts), _Base);
}

Expand Down
5 changes: 3 additions & 2 deletions stl/modules/std.ixx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// In a module-file, the optional `module;` must appear first; see [cpp.pre].
module;

// This named module expects to be built with classic headers, not header units.
#define _BUILD_STD_MODULE

module;

// The subset of "C headers" [tab:c.headers] corresponding to
// the "C++ headers for C library facilities" [tab:headers.cpp.c]
#include <assert.h>
Expand Down

0 comments on commit 9c988d8

Please sign in to comment.