On Sat, 18 Apr 2020, Jacek Caban wrote:
On 18.04.2020 14:51, Liu Hao wrote:
在 2020/4/17 20:25, Steve Lhomme 写道:
So we can restrict some C runtime APIs based on the target
family.
Based on this documentation some APIs are not allowed in
UWP builds
https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps?view=vs-2019
The documentation is old and may not apply to Win10 but
it's still the one
listed for UCRT compatibility :
https://docs.microsoft.com/en-us/cpp/c-runtime-library/compatibility?view=vs-2019
---
mingw-w64-headers/crt/corecrt.h | 2 ++
1 file changed, 2 insertions(+)
It seems that MS headers don't check for such configuration.
I also
consider it wrong to check for Windows API macros in CRT
headers.
As far as I can see, they do, but differently. corecrt.h
defines or not
_CRT_USE_WINAPI_FAMILY_DESKTOP_APP. If WINAPI_FAMILY is not
defined, it
just assumes desktop. Otherwise it includes winapifamily.h and
uses that
to do the check. That, at least, limits the dependency to
builds using
those features.
Other crt headers can just use
_CRT_USE_WINAPI_FAMILY_DESKTOP_APP.
Right - if winsdk ucrt headers use such a define, it's probably good to
mimic that (I hadn't checked before) - sorry about the detour.
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public