LoadLibrary is forbidden in such apps (can only load DLLs from within the app package). The API entries are available to all apps linking with the Windows API as found here: https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis
windowsapp.lib (and mincore.lib for Windows 8) are both available in MinGW as well. GetSystemTimePreciseAsFileTime is only allowed in Win10 UWP apps. --- lib/gettimeofday.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index 19804793a..087f7eada 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -45,12 +45,17 @@ static BOOL initialized = FALSE; static void initialize (void) { +#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && _WIN32_WINNT >= 0x0A00 /* _WIN32_WINNT_WIN10 */ + /* LoadLibrary not allowed but the functions are available with the windows runtime */ + GetSystemTimePreciseAsFileTimeFunc = GetSystemTimePreciseAsFileTime; +#else /* WINAPI_PARTITION_DESKTOP */ HMODULE kernel32 = LoadLibrary ("kernel32.dll"); if (kernel32 != NULL) { GetSystemTimePreciseAsFileTimeFunc = (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime"); } +#endif /* WINAPI_PARTITION_DESKTOP */ initialized = TRUE; } -- 2.26.2