File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,11 @@ _EXPORT_STD using _CSTD strftime;
2929_EXPORT_STD using _CSTD timespec;
3030#endif // _HAS_CXX17
3131
32- #ifdef _BUILD_STD_MODULE // TRANSITION, OS-33790456; `template <int = 0>` avoids ambiguity
32+ // `_STATIC_INLINE_UCRT_FUNCTIONS` is exposed by the UCRT starting on Windows SDK `10.0.26100.6901`.
33+ // When set to `1`, several UCRT functions are declared as `static inline` (for historical compatibility),
34+ // preventing them from being naively exported through modules.
35+ // In that case, we use templates to shadow their name, allowing us forcibly to export them.
36+ #if defined(_STATIC_INLINE_UCRT_FUNCTIONS) && _STATIC_INLINE_UCRT_FUNCTIONS == 1
3337_STL_DISABLE_DEPRECATED_WARNING
3438
3539_EXPORT_STD template <int = 0>
@@ -75,7 +79,7 @@ _Check_return_ inline int __CRTDECL timespec_get(_Out_ timespec* const _Ts, _In_
7579_STL_RESTORE_DEPRECATED_WARNING
7680#else // ^^^ workaround / no workaround vvv
7781
78- // _EXPORT_STD has no effect while the workaround is present .
82+ // _EXPORT_STD has no effect when `_BUILD_STD_MODULE` is not defined .
7983_EXPORT_STD using _CSTD ctime;
8084_EXPORT_STD using _CSTD difftime;
8185_EXPORT_STD using _CSTD gmtime;
You can’t perform that action at this time.
0 commit comments