]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Don't call GetOEMCP() in Universal Windows Platform builds
authorSteve Lhomme <robux4@ycbcr.xyz>
Wed, 24 May 2023 13:23:14 +0000 (15:23 +0200)
committerMartin Matuška <martin@matuska.de>
Thu, 13 Jul 2023 22:30:12 +0000 (00:30 +0200)
It's not available [1] [2]. However we can use the intermediate CP_OEMCP
value. It can be used to compare charsets in create_sconv_object().
It won't work with comparing charsets in archive_string_default_conversion_for_read()
and archive_string_default_conversion_for_write(). current_codepage being
an actual CodePage value.

[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-localization-l1-2-0dll
[2] https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getoemcp#requirements

libarchive/archive_string.c

index 69458e1a12b1d39105fd487eb68d75e024a781f8..accf52631a89cbfd675be5eab9ee14203e111e1c 100644 (file)
@@ -1324,6 +1324,10 @@ free_sconv_object(struct archive_string_conv *sc)
 }
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
+# if defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#  define GetOEMCP() CP_OEMCP
+# endif
+
 static unsigned
 my_atoi(const char *p)
 {