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.main
parent
4feac30cb2
commit
f0be76c0ce
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue