Skip to content

Commit

Permalink
Enable COM in classlibs for win32
Browse files Browse the repository at this point in the history
The runtime for Windows still has valid implementations for
COM calls. In the case of this bug IsComOjbect needs to behave
correctly.

The intention of this PR is to set DISABLE_COM for only mac
and linux for unity jit and unity apt profiles.

fixes case 1358705
  • Loading branch information
bholmes committed Sep 10, 2021
1 parent 3ade47b commit ea77bdf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 9 additions & 2 deletions mcs/build/profiles/unityaot.make
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ PROFILE_MCS_FLAGS = \
-d:UNITY \
-d:UNITY_AOT \
-d:MOBILE,MOBILE_LEGACY \
-d:DISABLE_COM \
-d:FULL_AOT_DESKTOP \
-d:FULL_AOT_RUNTIME \
$(PLATFORM_FLAGS) \
Expand All @@ -46,4 +45,12 @@ NO_INSTALL = yes
AOT_FRIENDLY_PROFILE = yes
ALWAYS_AOT_BCL = yes
MOBILE_PROFILE = yes
NO_SRE = yes
NO_SRE = yes

ifeq ($(HOST_PLATFORM),macos)
PROFILE_MCS_FLAGS += -d:DISABLE_COM
endif

ifeq ($(HOST_PLATFORM),linux)
PROFILE_MCS_FLAGS += -d:DISABLE_COM
endif
4 changes: 3 additions & 1 deletion mcs/build/profiles/unityjit.make
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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 -d:DISABLE_COM -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
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)
API_BIN_PROFILE = v4.7.1

FRAMEWORK_VERSION = 4.5
Expand All @@ -20,8 +20,10 @@ XBUILD_VERSION = 4.0
ifeq ($(HOST_PLATFORM),macos)
MONO_FEATURE_APPLETLS=1
ENABLE_GSS=1
PROFILE_MCS_FLAGS += -d:DISABLE_COM
endif

ifeq ($(HOST_PLATFORM),linux)
ENABLE_GSS=1
PROFILE_MCS_FLAGS += -d:DISABLE_COM
endif
2 changes: 1 addition & 1 deletion mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public static object GetUniqueObjectForIUnknown (IntPtr unknown)
throw new PlatformNotSupportedException ();
}

#if (!MOBILE && !UNITY) || UNITY_AOT
#if (!MOBILE && !DISABLE_COM) || (UNITY_AOT && !DISABLE_COM)
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern static bool IsComObject (object o);
#else
Expand Down

0 comments on commit ea77bdf

Please sign in to comment.