From 04f3c16b7536c6fb41e0f4d64801760336c05c04 Mon Sep 17 00:00:00 2001 From: Jonathan Chambers Date: Thu, 27 Jun 2024 13:29:06 -0400 Subject: [PATCH] Add UNITY_WIN_PLATFORM and use for platform check (case UUM-73753). Minimal fix to correct platform detection, as all platform unityjit profiles have WIN_PLATFORM already defined. --- mcs/build/profiles/unityjit.make | 11 ++++++++++- .../System.IO.Compression/corefx/Interop.Libraries.cs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mcs/build/profiles/unityjit.make b/mcs/build/profiles/unityjit.make index 94495c6d708b..098a84fa0fee 100644 --- a/mcs/build/profiles/unityjit.make +++ b/mcs/build/profiles/unityjit.make @@ -11,7 +11,16 @@ profile-check: @: DEFAULT_REFERENCES = mscorlib -PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:UNITY_JIT -d:UNITY -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS) + + +ifeq ($(HOST_PLATFORM),win32) +# The unityjit profiles for all platforms have had WIN_PLATFORM enabled +# for a number of years/releases. Rather than introduce risk of changing this +# add a unity specific version to selectively control changes to platform specific code. + PLATFORM_FLAGS = -d:UNITY_WIN_PLATFORM +endif + +PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:UNITY_JIT -d:UNITY -d:WIN_PLATFORM $(PLATFORM_FLAGS) -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS) API_BIN_PROFILE = v4.7.1 FRAMEWORK_VERSION = 4.5 diff --git a/mcs/class/System.IO.Compression/corefx/Interop.Libraries.cs b/mcs/class/System.IO.Compression/corefx/Interop.Libraries.cs index 7fffc66c9f1d..46d26c42e645 100644 --- a/mcs/class/System.IO.Compression/corefx/Interop.Libraries.cs +++ b/mcs/class/System.IO.Compression/corefx/Interop.Libraries.cs @@ -6,7 +6,7 @@ internal static partial class Interop { internal static partial class Libraries { -#if WIN_PLATFORM +#if (WIN_PLATFORM && !UNITY_JIT) || UNITY_WIN_PLATFORM internal const string CompressionNative = "__Internal"; #else internal const string CompressionNative = "System.Native";