diff --git a/stl/inc/ctime b/stl/inc/ctime index ae2f152edc4..4acc53ad979 100644 --- a/stl/inc/ctime +++ b/stl/inc/ctime @@ -29,7 +29,10 @@ _EXPORT_STD using _CSTD strftime; _EXPORT_STD using _CSTD timespec; #endif // _HAS_CXX17 -#ifdef _BUILD_STD_MODULE // TRANSITION, OS-33790456; `template ` avoids ambiguity +// `_STATIC_INLINE_UCRT_FUNCTIONS` is exposed by the UCRT. When set to `1`, several UCRT functions are declared as +// `static inline`, which prevents them from being naively exported through modules. Therefore, we templates +// to effectively shadow their name, allowing us forcibly to expose those CRT functions. +#if _STATIC_INLINE_UCRT_FUNCTIONS == 1 _STL_DISABLE_DEPRECATED_WARNING _EXPORT_STD template @@ -75,7 +78,7 @@ _Check_return_ inline int __CRTDECL timespec_get(_Out_ timespec* const _Ts, _In_ _STL_RESTORE_DEPRECATED_WARNING #else // ^^^ workaround / no workaround vvv -// _EXPORT_STD has no effect while the workaround is present. +// _EXPORT_STD has no effect when `_BUILD_STD_MODULE` is not defined. _EXPORT_STD using _CSTD ctime; _EXPORT_STD using _CSTD difftime; _EXPORT_STD using _CSTD gmtime;