mirror of
https://github.com/focus-creative-games/hybridclr_unity.git
synced 2026-11-19 14:52:41 +08:00
fix: correct conditional compilation macro for Windows standalone targeting
Fixes an issue where 'UNITY_STANDALONE_WIN' is incorrectly defined when building or targeting Windows standalone from a non-Windows Unity Editor (e.g., macOS/Linux). This caused the Editor to incorrectly hit the Windows code path (kernel32.dll / VirtualProtect) instead of the POSIX one, leading to compilation errors or runtime crashes during the build process.
This commit is contained in:
@@ -50,7 +50,7 @@ namespace MonoHook
|
||||
if (ptr == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
|
||||
#if UNITY_EDITOR_WIN || (!UNITY_EDITOR && UNITY_STANDALONE_WIN)
|
||||
uint oldProtect;
|
||||
bool ret = VirtualProtect(ptr, (uint)size, Protection.PAGE_EXECUTE_READWRITE, out oldProtect);
|
||||
UnityEngine.Debug.Assert(ret);
|
||||
@@ -223,7 +223,7 @@ namespace MonoHook
|
||||
};
|
||||
|
||||
|
||||
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
|
||||
#if UNITY_EDITOR_WIN || (!UNITY_EDITOR && UNITY_STANDALONE_WIN)
|
||||
[Flags]
|
||||
public enum Protection
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user