Codestyle fix and doc

This commit is contained in:
Wojtek Figat
2023-09-20 22:14:54 +02:00
parent 386e097fe9
commit bcce08e81c

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System.Runtime.InteropServices;
namespace Flax.Build.Platforms
@@ -43,19 +44,19 @@ namespace Flax.Build.Platforms
}
}
[DllImport ("c")]
public static unsafe extern int sysctlbyname (
string name, void* oldp, ulong *oldlenp, void* newp, ulong newlen);
/// <summary>
/// Returns true if running an x64 binary an arm64 host machine.
/// </summary>
public unsafe static bool GetProcessIsTranslated()
{
int ret = 0;
ulong size = sizeof (int);
if (sysctlbyname ("sysctl.proc_translated", &ret, &size, null, 0) == -1) {
ulong size = sizeof(int);
if (sysctlbyname("sysctl.proc_translated", &ret, &size, null, 0) == -1)
return false;
}
return ret != 0;
}
[DllImport("c")]
private static unsafe extern int sysctlbyname(string name, void* oldp, ulong* oldlenp, void* newp, ulong newlen);
}
}