* Fix lstat P/Invoke on arm64

* Bump TargetFrameworkVersion for mmp (to match mtouch)
This commit is contained in:
Filip Navara 2021-08-16 16:21:21 +02:00 коммит произвёл GitHub
Родитель e3969482a8
Коммит 454831f613
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -187,8 +187,20 @@ namespace Xamarin.Utils
public ulong st_qspare_2;
}
[DllImport ("/usr/lib/libSystem.dylib", EntryPoint = "lstat$INODE64", SetLastError = true)]
static extern int lstat (string path, out stat buf);
[DllImport ("/usr/lib/libc.dylib", EntryPoint = "lstat$INODE64", SetLastError = true)]
static extern int lstat_x64 (string file_name, out stat buf);
[DllImport ("/usr/lib/libc.dylib", EntryPoint = "lstat", SetLastError = true)]
static extern int lstat_arm64 (string file_name, out stat buf);
static int lstat (string path, out stat buf)
{
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64) {
return lstat_arm64 (path, out buf);
} else {
return lstat_x64 (path, out buf);
}
}
public static bool IsSymlink (string file)
{

Просмотреть файл

@ -7,7 +7,7 @@
<OutputType>Exe</OutputType>
<AssemblyName>mmp</AssemblyName>
<RootNamespace>mmp</RootNamespace>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">