Use proper preprocessor checks for UWP

This commit is contained in:
Pedro J. Estébanez 2023-02-10 14:14:43 +01:00 committed by Behdad Esfahbod
parent 96d9e8624c
commit b1680e9143
2 changed files with 4 additions and 4 deletions

View File

@ -676,7 +676,7 @@ fail_without_close:
wchar_t * wchar_file_name = (wchar_t *) hb_malloc (sizeof (wchar_t) * size); wchar_t * wchar_file_name = (wchar_t *) hb_malloc (sizeof (wchar_t) * size);
if (unlikely (!wchar_file_name)) goto fail_without_close; if (unlikely (!wchar_file_name)) goto fail_without_close;
mbstowcs (wchar_file_name, file_name, size); mbstowcs (wchar_file_name, file_name, size);
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
{ {
CREATEFILE2_EXTENDED_PARAMETERS ceparams = { 0 }; CREATEFILE2_EXTENDED_PARAMETERS ceparams = { 0 };
ceparams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); ceparams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
@ -697,7 +697,7 @@ fail_without_close:
if (unlikely (fd == INVALID_HANDLE_VALUE)) goto fail_without_close; if (unlikely (fd == INVALID_HANDLE_VALUE)) goto fail_without_close;
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
{ {
LARGE_INTEGER length; LARGE_INTEGER length;
GetFileSizeEx (fd, &length); GetFileSizeEx (fd, &length);
@ -710,7 +710,7 @@ fail_without_close:
#endif #endif
if (unlikely (!file->mapping)) goto fail; if (unlikely (!file->mapping)) goto fail;
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
file->contents = (char *) MapViewOfFileFromApp (file->mapping, FILE_MAP_READ, 0, 0); file->contents = (char *) MapViewOfFileFromApp (file->mapping, FILE_MAP_READ, 0, 0);
#else #else
file->contents = (char *) MapViewOfFile (file->mapping, FILE_MAP_READ, 0, 0, 0); file->contents = (char *) MapViewOfFile (file->mapping, FILE_MAP_READ, 0, 0, 0);

View File

@ -60,7 +60,7 @@ typedef pthread_mutex_t hb_mutex_impl_t;
#elif !defined(HB_NO_MT) && !defined(HB_MUTEX_IMPL_STD_MUTEX) && defined(_WIN32) #elif !defined(HB_NO_MT) && !defined(HB_MUTEX_IMPL_STD_MUTEX) && defined(_WIN32)
typedef CRITICAL_SECTION hb_mutex_impl_t; typedef CRITICAL_SECTION hb_mutex_impl_t;
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define hb_mutex_impl_init(M) InitializeCriticalSectionEx (M, 0, 0) #define hb_mutex_impl_init(M) InitializeCriticalSectionEx (M, 0, 0)
#else #else
#define hb_mutex_impl_init(M) InitializeCriticalSection (M) #define hb_mutex_impl_init(M) InitializeCriticalSection (M)