Support new Darwin platform prefix

GitOrigin-RevId: 953e9a6932d94e4f483b76ff658b10f785ab041e
This commit is contained in:
Aleksey Tomin
2021-09-07 07:01:42 +00:00
committed by intellij-monorepo-bot
parent a2ab3d601f
commit 78713364aa
@@ -288,11 +288,12 @@ public final class FileSystemUtil {
else if ("linux-ppc".equals(Platform.RESOURCE_PREFIX)) myOffsets = LNX_PPC32;
else if ("linux-ppc64le".equals(Platform.RESOURCE_PREFIX)) myOffsets = LNX_PPC64;
else if ("darwin".equals(Platform.RESOURCE_PREFIX)) myOffsets = BSD_64;
else if ("darwin-x86-64".equals(Platform.RESOURCE_PREFIX)) myOffsets = BSD_64;
else if ("freebsd-x86".equals(Platform.RESOURCE_PREFIX)) myOffsets = SystemInfo.isOsVersionAtLeast("12") ? BSD_32_12 : BSD_32;
else if ("freebsd-x86-64".equals(Platform.RESOURCE_PREFIX)) myOffsets = SystemInfo.isOsVersionAtLeast("12") ? BSD_64_12 : BSD_64;
else if ("sunos-x86".equals(Platform.RESOURCE_PREFIX)) myOffsets = SUN_OS_32;
else if ("sunos-x86-64".equals(Platform.RESOURCE_PREFIX)) myOffsets = SUN_OS_64;
else throw new IllegalStateException("Unsupported OS/arch: " + SystemInfo.OS_NAME + "/" + SystemInfo.OS_ARCH);
else throw new IllegalStateException("Unsupported OS/arch: " + Platform.RESOURCE_PREFIX);
Map<String, String> options = Collections.singletonMap(Library.OPTION_STRING_ENCODING, CharsetToolkit.getPlatformCharset().name());
NativeLibrary lib = NativeLibrary.getInstance("c", options);