Fix lstat P/Invoke on arm64 (#12437)
* Fix lstat P/Invoke on arm64 * Bump TargetFrameworkVersion for mmp (to match mtouch)
This commit is contained in:
Родитель
e3969482a8
Коммит
454831f613
|
@ -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' ">
|
||||
|
|
Загрузка…
Ссылка в новой задаче