diff options
Diffstat (limited to 'mcs/class')
28 files changed, 27 insertions, 487 deletions
diff --git a/mcs/class/Makefile b/mcs/class/Makefile index 52df09fc01c..10cef9b26d0 100644 --- a/mcs/class/Makefile +++ b/mcs/class/Makefile @@ -1,6 +1,6 @@ thisdir = class -NO_FACADES_PROFILE := $(filter monodroid_tools monotouch_tools wasm_tools binary_reference_assemblies xbuild_12 xbuild_14 netcore, $(PROFILE)) +NO_FACADES_PROFILE := $(filter monodroid_tools monotouch_tools wasm_tools binary_reference_assemblies xbuild_12 xbuild_14, $(PROFILE)) ifndef NO_FACADES_PROFILE FACADES_FOLDER := Facades @@ -452,15 +452,12 @@ wasm_PARALLEL_SUBDIRS := $(wasm_dirs_parallel) wasm_tools_SUBDIRS := wasm_tools_PARALLEL_SUBDIRS := $(wasm_tools_dirs_parallel) -netcore_SUBDIRS := -netcore_PARALLEL_SUBDIRS := - include ../build/rules.make DIST_SUBDIRS = $(testing_aot_full_dirs_parallel) $(testing_aot_hybrid_dirs_parallel) $(monotouch_dirs_parallel) $(monotouch_tools_dirs_parallel) \ $(monodroid_dirs_parallel) $(monodroid_tools_dirs_parallel) $(xammac_dirs_parallel) $(net_4_x_dirs) $(net_4_x_parallel_dirs) \ $(xammac_4_5_dirs_parallel) $(unreal_dirs_parallel) $(wasm_dirs_parallel) $(wasm_tools_dirs_parallel) $(xbuild_14_SUBDIRS) \ -$(testing_aot_full_interp_dirs_parallel) $(netcore_SUBDIRS) dlr aot-compiler reference-assemblies Facades +$(testing_aot_full_interp_dirs_parallel) dlr aot-compiler reference-assemblies Facades # No new makefiles for: System.Messaging, System.Web.Mobile, # System.ServiceProcess diff --git a/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs b/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs index 6b759a06b8c..192c409c3fe 100644 --- a/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs +++ b/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs @@ -13,6 +13,7 @@ namespace MonoTests.System.Net.NetworkInformation partial void AndroidShouldPingWork (ref bool shouldWork); [Test] + [Category("AndroidNotWorking")] // fails on CI for some reason public void PingFail() { #if MONOTOUCH @@ -65,6 +66,7 @@ namespace MonoTests.System.Net.NetworkInformation } [Test] + [Category("AndroidNotWorking")] // fails on CI for some reason #if MONOTOUCH [Ignore("Ping implementation is broken on MT (requires sudo access)")] #endif @@ -109,6 +111,7 @@ namespace MonoTests.System.Net.NetworkInformation [Test] [Category("MultiThreaded")] + [Category("AndroidNotWorking")] // fails on CI for some reason #if MONOTOUCH [Ignore("Ping implementation is broken on MT (requires sudo access)")] #endif diff --git a/mcs/class/corlib/Mono/RuntimeStructs.cs b/mcs/class/corlib/Mono/RuntimeStructs.cs index ae0255124d4..00b0b15c2cc 100644 --- a/mcs/class/corlib/Mono/RuntimeStructs.cs +++ b/mcs/class/corlib/Mono/RuntimeStructs.cs @@ -63,11 +63,7 @@ namespace Mono { internal uint hash_alg; internal uint hash_len; internal uint flags; -#if NETCORE - internal int major, minor, build, revision; -#else internal ushort major, minor, build, revision; -#endif internal ushort arch; } diff --git a/mcs/class/corlib/ReferenceSources/Buffer.cs b/mcs/class/corlib/ReferenceSources/Buffer.cs index 5c83291cf5c..9a6edeab2eb 100644 --- a/mcs/class/corlib/ReferenceSources/Buffer.cs +++ b/mcs/class/corlib/ReferenceSources/Buffer.cs @@ -7,10 +7,6 @@ using nuint = System.UInt32; using System.Runtime.CompilerServices; using System.Runtime; -#if NETCORE -using Internal.Runtime.CompilerServices; -#endif - namespace System { partial class Buffer diff --git a/mcs/class/corlib/ReferenceSources/JitHelpers.cs b/mcs/class/corlib/ReferenceSources/JitHelpers.cs index 79f242e4fca..80038fdf94d 100644 --- a/mcs/class/corlib/ReferenceSources/JitHelpers.cs +++ b/mcs/class/corlib/ReferenceSources/JitHelpers.cs @@ -17,13 +17,5 @@ namespace System.Runtime.CompilerServices { { return Array.UnsafeMov<T, long> (val); } - -#if NETCORE - [Intrinsic] - internal static bool EnumEquals<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException (); - - [Intrinsic] - internal static int EnumCompareTo<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException (); -#endif } }
\ No newline at end of file diff --git a/mcs/class/corlib/ReferenceSources/RuntimeType.cs b/mcs/class/corlib/ReferenceSources/RuntimeType.cs index 677c97e67a6..5adefd237a1 100644 --- a/mcs/class/corlib/ReferenceSources/RuntimeType.cs +++ b/mcs/class/corlib/ReferenceSources/RuntimeType.cs @@ -159,11 +159,7 @@ namespace System { var ctor = GetDefaultConstructor (); if (!nonPublic && ctor != null && !ctor.IsPublic) { -#if NETCORE - throw new MissingMethodException(SR.Format(SR.Arg_NoDefCTor, FullName)); -#else ctor = null; -#endif } if (ctor == null) { @@ -432,11 +428,7 @@ namespace System public override StructLayoutAttribute StructLayoutAttribute { get { -#if NETCORE - return GetStructLayoutAttribute (); -#else return StructLayoutAttribute.GetCustomAttribute (this); -#endif } } @@ -716,11 +708,7 @@ namespace System var a = new RuntimeEventInfo[n]; for (int i = 0; i < n; i++) { var eh = new Mono.RuntimeEventHandle (h[i]); -#if NETCORE - a[i] = (RuntimeEventInfo) RuntimeEventInfo.GetEventFromHandle (eh, refh); -#else a[i] = (RuntimeEventInfo) EventInfo.GetEventFromHandle (eh, refh); -#endif } return a; } @@ -735,13 +723,8 @@ namespace System RuntimeType[] GetNestedTypes_internal (string displayName, BindingFlags bindingAttr, MemberListType listType) { string internalName = null; -#if NETCORE - if (displayName != null) - internalName = displayName; -#else if (displayName != null) internalName = TypeIdentifiers.FromDisplay (displayName).InternalName; -#endif using (var namePtr = new Mono.SafeStringMarshal (internalName)) using (var h = new Mono.SafeGPtrArrayHandle (GetNestedTypes_native (namePtr.Value, bindingAttr, listType))) { int n = h.Length; @@ -775,19 +758,7 @@ namespace System get; } -#if NETCORE - public override bool IsSecurityTransparent { - get { return false; } - } - - public override bool IsSecurityCritical { - get { return true; } - } - - public override bool IsSecuritySafeCritical { - get { return false; } - } -#elif MOBILE +#if MOBILE static int get_core_clr_security_level () { return 1; @@ -810,7 +781,6 @@ namespace System } #endif -#if !NETCORE public override int GetHashCode() { Type t = UnderlyingSystemType; @@ -818,7 +788,6 @@ namespace System return t.GetHashCode (); return (int)_impl.Value; } -#endif public override string FullName { get { @@ -874,44 +843,5 @@ namespace System } public override bool IsTypeDefinition => RuntimeTypeHandle.IsTypeDefinition (this); - -#if NETCORE - private const int DEFAULT_PACKING_SIZE = 8; - - internal StructLayoutAttribute GetStructLayoutAttribute () - { - if (IsInterface || HasElementType || IsGenericParameter) - return null; - - int pack = 0, size = 0; - LayoutKind layoutKind = LayoutKind.Auto; - switch (Attributes & TypeAttributes.LayoutMask) - { - case TypeAttributes.ExplicitLayout: layoutKind = LayoutKind.Explicit; break; - case TypeAttributes.AutoLayout: layoutKind = LayoutKind.Auto; break; - case TypeAttributes.SequentialLayout: layoutKind = LayoutKind.Sequential; break; - default: Contract.Assume(false); break; - } - - CharSet charSet = CharSet.None; - switch (Attributes & TypeAttributes.StringFormatMask) - { - case TypeAttributes.AnsiClass: charSet = CharSet.Ansi; break; - case TypeAttributes.AutoClass: charSet = CharSet.Auto; break; - case TypeAttributes.UnicodeClass: charSet = CharSet.Unicode; break; - default: Contract.Assume(false); break; - } - - GetPacking (out pack, out size); - - // Metadata parameter checking should not have allowed 0 for packing size. - // The runtime later converts a packing size of 0 to 8 so do the same here - // because it's more useful from a user perspective. - if (pack == 0) - pack = DEFAULT_PACKING_SIZE; - - return new StructLayoutAttribute (layoutKind) { Pack = pack, Size = size, CharSet = charSet }; - } -#endif // NETCORE } } diff --git a/mcs/class/corlib/ReferenceSources/Type.cs b/mcs/class/corlib/ReferenceSources/Type.cs index 28fbf135b2a..0ec84be383c 100644 --- a/mcs/class/corlib/ReferenceSources/Type.cs +++ b/mcs/class/corlib/ReferenceSources/Type.cs @@ -206,13 +206,11 @@ namespace System return !object.ReferenceEquals (left, right); } -#if !NETCORE [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable public static Type ReflectionOnlyGetType (String typeName, bool throwIfNotFound, bool ignoreCase) { StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RuntimeType.GetType (typeName, throwIfNotFound, ignoreCase, true /*reflectionOnly*/, ref stackMark); } -#endif } } diff --git a/mcs/class/corlib/System.Diagnostics/StackTrace.cs b/mcs/class/corlib/System.Diagnostics/StackTrace.cs index a70b0ae7d88..0b294661516 100644 --- a/mcs/class/corlib/System.Diagnostics/StackTrace.cs +++ b/mcs/class/corlib/System.Diagnostics/StackTrace.cs @@ -43,9 +43,7 @@ namespace System.Diagnostics { [Serializable] [ComVisible (true)] -#if !NETCORE [MonoTODO ("Serialized objects are not compatible with .NET")] -#endif public class StackTrace { // TraceFormat is Used to specify options for how the @@ -148,9 +146,7 @@ namespace System.Diagnostics { this.frames [0] = frame; } -#if !NETCORE [MonoLimitation ("Not possible to create StackTraces from other threads")] -#endif [Obsolete] public StackTrace (Thread targetThread, bool needFileInfo) { diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs index b21a89a7162..26eff979c6b 100644 --- a/mcs/class/corlib/System.Globalization/CultureInfo.cs +++ b/mcs/class/corlib/System.Globalization/CultureInfo.cs @@ -313,9 +313,7 @@ namespace System.Globalization } } -#if !NETCORE [MonoLimitation ("Optional calendars are not supported only default calendar is returned")] -#endif public virtual Calendar[] OptionalCalendars { get { return new[] { Calendar }; @@ -788,9 +786,7 @@ namespace System.Globalization } } -#if !NETCORE [MonoTODO ("Currently it ignores the altName parameter")] -#endif public static CultureInfo GetCultureInfo (string name, string altName) { if (name == null) throw new ArgumentNullException ("null"); diff --git a/mcs/class/corlib/System.Reflection/AssemblyName.cs b/mcs/class/corlib/System.Reflection/AssemblyName.cs index abcd1664c60..d2a5e82bd91 100644 --- a/mcs/class/corlib/System.Reflection/AssemblyName.cs +++ b/mcs/class/corlib/System.Reflection/AssemblyName.cs @@ -40,7 +40,7 @@ using System.Runtime.CompilerServices; using System.IO; using Mono; -#if !MOBILE && !NETCORE +#if !MOBILE using Mono.Security.Cryptography; #endif @@ -51,13 +51,11 @@ namespace System.Reflection { // http://www.ietf.org/rfc/rfc2396.txt [ComVisible (true)] -#if !NETCORE [ComDefaultInterfaceAttribute (typeof (_AssemblyName))] [ClassInterfaceAttribute (ClassInterfaceType.None)] -#endif [Serializable] [StructLayout (LayoutKind.Sequential)] -#if MOBILE || NETCORE +#if MOBILE public sealed partial class AssemblyName : ICloneable, ISerializable, IDeserializationCallback { #else public sealed class AssemblyName : ICloneable, ISerializable, IDeserializationCallback, _AssemblyName { @@ -279,7 +277,7 @@ namespace System.Reflection { switch (publicKey [0]) { case 0x00: // public key inside a header if (publicKey.Length > 12 && publicKey [12] == 0x06) { -#if MOBILE || NETCORE +#if MOBILE return true; #else return CryptoConvert.TryImportCapiPublicKeyBlob (publicKey, 12); @@ -287,7 +285,7 @@ namespace System.Reflection { } break; case 0x06: // public key -#if MOBILE || NETCORE +#if MOBILE return true; #else return CryptoConvert.TryImportCapiPublicKeyBlob (publicKey, 0); @@ -419,7 +417,7 @@ namespace System.Reflection { return aname; } -#if !MOBILE && !NETCORE +#if !MOBILE void _AssemblyName.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) { throw new NotImplementedException (); @@ -473,13 +471,8 @@ namespace System.Reflection { this.major = native->major; this.minor = native->minor; -#if NETCORE - this.build = native->build == 65535 ? -1 : native->build; - this.revision = native->revision == 65535 ? -1 : native->revision; -#else this.build = native->build; this.revision = native->revision; -#endif this.flags = (AssemblyNameFlags)native->flags; @@ -488,29 +481,13 @@ namespace System.Reflection { this.versioncompat = AssemblyVersionCompatibility.SameMachine; this.processor_architecture = (ProcessorArchitecture)native->arch; -#if NETCORE - if (addVersion) { - if (this.build == -1) - this.version = new Version (this.major, this.minor); - else if (this.revision == -1) - this.version = new Version (this.major, this.minor, this.build); - else - this.version = new Version (this.major, this.minor, this.build, this.revision); - } -#else if (addVersion) this.version = new Version (this.major, this.minor, this.build, this.revision); -#endif this.codebase = codeBase; -#if NETCORE - if (native->culture != IntPtr.Zero) - this.cultureinfo = CultureInfo.GetCultureInfo (RuntimeMarshal.PtrToUtf8String (native->culture)); -#else if (native->culture != IntPtr.Zero) this.cultureinfo = CultureInfo.CreateCulture ( RuntimeMarshal.PtrToUtf8String (native->culture), assemblyRef); -#endif if (native->public_key != IntPtr.Zero) { this.publicKey = RuntimeMarshal.DecodeBlobArray (native->public_key); @@ -542,11 +519,5 @@ namespace System.Reflection { } return aname; } - -#if NETCORE - internal static string EscapeCodeBase (string codebase) { - throw new NotImplementedException (); - } -#endif } } diff --git a/mcs/class/corlib/System.Reflection/CustomAttributeData.cs b/mcs/class/corlib/System.Reflection/CustomAttributeData.cs index 069db8bf86a..f86eaf22773 100644 --- a/mcs/class/corlib/System.Reflection/CustomAttributeData.cs +++ b/mcs/class/corlib/System.Reflection/CustomAttributeData.cs @@ -144,9 +144,6 @@ namespace System.Reflection { return MonoCustomAttrs.GetCustomAttributesData (target); } -#if NETCORE - virtual -#endif public Type AttributeType { get { return ctorInfo.DeclaringType; } } @@ -188,9 +185,6 @@ namespace System.Reflection { public override bool Equals (object obj) { -#if NETCORE - return obj == (object)this; -#else CustomAttributeData other = obj as CustomAttributeData; if (other == null || other.ctorInfo != ctorInfo || other.ctorArgs.Count != ctorArgs.Count || @@ -210,14 +204,10 @@ namespace System.Reflection { return false; } return true; -#endif } public override int GetHashCode () { -#if NETCORE - return base.GetHashCode (); -#else int ret = ctorInfo == null ? 13 : (ctorInfo.GetHashCode () << 16); // argument order-dependent if (ctorArgs != null) { @@ -231,7 +221,6 @@ namespace System.Reflection { ret += (namedArgs [i].GetHashCode () << 5); } return ret; -#endif } } diff --git a/mcs/class/corlib/System.Reflection/RuntimeEventInfo.cs b/mcs/class/corlib/System.Reflection/RuntimeEventInfo.cs index 0d2a7ed3d4d..2770576edd2 100644 --- a/mcs/class/corlib/System.Reflection/RuntimeEventInfo.cs +++ b/mcs/class/corlib/System.Reflection/RuntimeEventInfo.cs @@ -54,9 +54,7 @@ namespace System.Reflection { [Serializable] [StructLayout (LayoutKind.Sequential)] internal sealed class RuntimeEventInfo : EventInfo -#if !NETCORE , ISerializable -#endif { #pragma warning disable 169 IntPtr klass; @@ -101,7 +99,6 @@ namespace System.Reflection { return GetDeclaringTypeInternal ().GetRuntimeModule (); } -#if !NETCORE #region ISerializable public void GetObjectData(SerializationInfo info, StreamingContext context) { @@ -117,7 +114,6 @@ namespace System.Reflection { MemberTypes.Event); } #endregion -#endif internal BindingFlags GetBindingFlags () { @@ -235,20 +231,5 @@ namespace System.Reflection { [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern int get_metadata_token (RuntimeEventInfo monoEvent); - -#if NETCORE - [MethodImplAttribute (MethodImplOptions.InternalCall)] - static extern EventInfo internal_from_handle_type (IntPtr event_handle, IntPtr type_handle); - - internal static EventInfo GetEventFromHandle (Mono.RuntimeEventHandle handle, RuntimeTypeHandle reflectedType) - { - if (handle.Value == IntPtr.Zero) - throw new ArgumentException ("The handle is invalid."); - EventInfo ei = internal_from_handle_type (handle.Value, reflectedType.Value); - if (ei == null) - throw new ArgumentException ("The event handle and the type handle are incompatible."); - return ei; - } -#endif } } diff --git a/mcs/class/corlib/System.Reflection/RuntimeFieldInfo.cs b/mcs/class/corlib/System.Reflection/RuntimeFieldInfo.cs index 97ade331674..858ce984e34 100644 --- a/mcs/class/corlib/System.Reflection/RuntimeFieldInfo.cs +++ b/mcs/class/corlib/System.Reflection/RuntimeFieldInfo.cs @@ -52,9 +52,7 @@ namespace System.Reflection { [Serializable] [StructLayout (LayoutKind.Sequential)] class RuntimeFieldInfo : RtFieldInfo -#if !NETCORE , ISerializable -#endif { #pragma warning disable 649 internal IntPtr klass; @@ -92,7 +90,6 @@ namespace System.Reflection { return GetDeclaringTypeInternal ().GetRuntimeModule (); } -#if !NETCORE #region ISerializable Implementation public void GetObjectData(SerializationInfo info, StreamingContext context) { @@ -107,7 +104,6 @@ namespace System.Reflection { MemberTypes.Field); } #endregion -#endif [MethodImplAttribute(MethodImplOptions.InternalCall)] internal override extern object UnsafeGetValue (object obj); @@ -309,24 +305,6 @@ namespace System.Reflection { { return 1; } -#elif NETCORE - public override bool IsSecurityTransparent { - get { - return false; - } - } - - public override bool IsSecurityCritical { - get { - return true; - } - } - - public override bool IsSecuritySafeCritical { - get { - return false; - } - } #else //seclevel { transparent = 0, safe-critical = 1, critical = 2} [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs b/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs index 3cb1b43173d..370a2e58f44 100644 --- a/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs +++ b/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs @@ -46,41 +46,6 @@ using System.Diagnostics; namespace System.Reflection { -#if NETCORE - [Flags()] - internal enum PInvokeAttributes - { - NoMangle = 0x0001, - - CharSetMask = 0x0006, - CharSetNotSpec = 0x0000, - CharSetAnsi = 0x0002, - CharSetUnicode = 0x0004, - CharSetAuto = 0x0006, - - BestFitUseAssem = 0x0000, - BestFitEnabled = 0x0010, - BestFitDisabled = 0x0020, - BestFitMask = 0x0030, - - ThrowOnUnmappableCharUseAssem = 0x0000, - ThrowOnUnmappableCharEnabled = 0x1000, - ThrowOnUnmappableCharDisabled = 0x2000, - ThrowOnUnmappableCharMask = 0x3000, - - SupportsLastError = 0x0040, - - CallConvMask = 0x0700, - CallConvWinapi = 0x0100, - CallConvCdecl = 0x0200, - CallConvStdcall = 0x0300, - CallConvThiscall = 0x0400, - CallConvFastcall = 0x0500, - - MaxValue = 0xFFFF, - } -#endif - internal struct MonoMethodInfo { #pragma warning disable 649 @@ -153,9 +118,7 @@ namespace System.Reflection { [Serializable()] [StructLayout (LayoutKind.Sequential)] class RuntimeMethodInfo : MethodInfo -#if !NETCORE , ISerializable -#endif { #pragma warning disable 649 internal IntPtr mhandle; @@ -181,11 +144,7 @@ namespace System.Reflection { } } -#if NETCORE - string FormatNameAndSig (bool serialization) -#else internal override string FormatNameAndSig (bool serialization) -#endif { // Serialization uses ToString to resolve MethodInfo overloads. StringBuilder sbName = new StringBuilder(Name); @@ -224,7 +183,6 @@ namespace System.Reflection { return ((RuntimeType)DeclaringType).GetRuntimeModule(); } -#if !NETCORE #region ISerializable Implementation public void GetObjectData(SerializationInfo info, StreamingContext context) { @@ -246,7 +204,6 @@ namespace System.Reflection { return ReturnType.FormatTypeName(true) + " " + FormatNameAndSig(true); } #endregion -#endif internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle) { @@ -259,11 +216,7 @@ namespace System.Reflection { } [MethodImplAttribute (MethodImplOptions.InternalCall)] -#if NETCORE - [PreserveDependency(".ctor(System.Reflection.ExceptionHandlingClause[],System.Reflection.LocalVariableInfo[],System.Byte[],System.Boolean,System.Int32,System.Int32)", "System.Reflection.RuntimeMethodBody")] -#else [PreserveDependency(".ctor(System.Reflection.ExceptionHandlingClause[],System.Reflection.LocalVariableInfo[],System.Byte[],System.Boolean,System.Int32,System.Int32)", "System.Reflection.MethodBody")] -#endif internal extern static MethodBody GetMethodBodyInternal (IntPtr handle); internal static MethodBody GetMethodBody (IntPtr handle) @@ -399,10 +352,6 @@ namespace System.Reflection { } catch (MethodAccessException) { throw; #endif -#if NETCORE - } catch (Mono.NullByRefReturnException) { - throw new NullReferenceException (); -#endif } catch (OverflowException) { throw; } catch (Exception e) { @@ -411,15 +360,7 @@ namespace System.Reflection { } else { -#if NETCORE - try { - o = InternalInvoke (obj, parameters, out exc); - } catch (Mono.NullByRefReturnException) { - throw new NullReferenceException (); - } -#else o = InternalInvoke (obj, parameters, out exc); -#endif } if (exc != null) @@ -525,62 +466,12 @@ namespace System.Reflection { if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0) attrs [count ++] = new PreserveSigAttribute (); if ((info.attrs & MethodAttributes.PinvokeImpl) != 0) { -#if NETCORE - attrs [count ++] = GetDllImportAttribute (); -#else attrs [count ++] = DllImportAttribute.GetCustomAttribute (this); -#endif } return attrs; } -#if NETCORE - Attribute GetDllImportAttribute () - { - string entryPoint, dllName = null; - int token = MetadataToken; - PInvokeAttributes flags = 0; - - GetPInvoke (out flags, out entryPoint, out dllName); - - CharSet charSet = CharSet.None; - - switch (flags & PInvokeAttributes.CharSetMask) { - case PInvokeAttributes.CharSetNotSpec: charSet = CharSet.None; break; - case PInvokeAttributes.CharSetAnsi: charSet = CharSet.Ansi; break; - case PInvokeAttributes.CharSetUnicode: charSet = CharSet.Unicode; break; - case PInvokeAttributes.CharSetAuto: charSet = CharSet.Auto; break; - - // Invalid: default to CharSet.None - default: break; - } - - CallingConvention callingConvention = InteropServicesCallingConvention.Cdecl; - - switch (flags & PInvokeAttributes.CallConvMask) { - case PInvokeAttributes.CallConvWinapi: callingConvention = InteropServicesCallingConvention.Winapi; break; - case PInvokeAttributes.CallConvCdecl: callingConvention = InteropServicesCallingConvention.Cdecl; break; - case PInvokeAttributes.CallConvStdcall: callingConvention = InteropServicesCallingConvention.StdCall; break; - case PInvokeAttributes.CallConvThiscall: callingConvention = InteropServicesCallingConvention.ThisCall; break; - case PInvokeAttributes.CallConvFastcall: callingConvention = InteropServicesCallingConvention.FastCall; break; - - // Invalid: default to CallingConvention.Cdecl - default: break; - } - - bool exactSpelling = (flags & PInvokeAttributes.NoMangle) != 0; - bool setLastError = (flags & PInvokeAttributes.SupportsLastError) != 0; - bool bestFitMapping = (flags & PInvokeAttributes.BestFitMask) == PInvokeAttributes.BestFitEnabled; - bool throwOnUnmappableChar = (flags & PInvokeAttributes.ThrowOnUnmappableCharMask) == PInvokeAttributes.ThrowOnUnmappableCharEnabled; - bool preserveSig = (GetMethodImplementationFlags() & MethodImplAttributes.PreserveSig) != 0; - - return new DllImportAttribute (dllName) { EntryPoint = entryPoint, CharSet = charSet, SetLastError = setLastError, - ExactSpelling = exactSpelling, PreserveSig = preserveSig, BestFitMapping = bestFitMapping, - ThrowOnUnmappableChar = throwOnUnmappableChar, CallingConvention = callingConvention }; - } -#endif // NETCORE - internal CustomAttributeData[] GetPseudoCustomAttributesData () { int count = 0; @@ -835,9 +726,6 @@ namespace System.Reflection { { if (info == null) throw new ArgumentNullException("info"); -#if NETCORE - throw new NotImplementedException (); -#else MemberInfoSerializationHolder.GetSerializationInfo( info, Name, @@ -846,17 +734,12 @@ namespace System.Reflection { SerializationToString(), MemberTypes.Constructor, null); -#endif } internal string SerializationToString() { -#if NETCORE - throw new NotImplementedException (); -#else // We don't need the return type for constructors. return FormatNameAndSig(true); -#endif } internal void SerializationInvoke (Object target, SerializationInfo info, StreamingContext context) @@ -1019,20 +902,7 @@ namespace System.Reflection { } public override string ToString () { -#if NETCORE - StringBuilder sbName = new StringBuilder(Name); - sbName.Append ("Void "); - - TypeNameFormatFlags format = TypeNameFormatFlags.FormatBasic; - - sbName.Append("("); - RuntimeParameterInfo.FormatParameters (sbName, GetParametersNoCopy (), CallingConvention, false); - sbName.Append(")"); - - return sbName.ToString(); -#else return "Void " + FormatNameAndSig (false); -#endif } public override IList<CustomAttributeData> GetCustomAttributesData () { diff --git a/mcs/class/corlib/System.Reflection/RuntimeModule.cs b/mcs/class/corlib/System.Reflection/RuntimeModule.cs index 92caa4c8547..0defda647df 100644 --- a/mcs/class/corlib/System.Reflection/RuntimeModule.cs +++ b/mcs/class/corlib/System.Reflection/RuntimeModule.cs @@ -32,19 +32,15 @@ using System.Collections.Generic; using System.Globalization; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; -#if !NETCORE using System.Security.Cryptography.X509Certificates; using System.Security; using System.Security.Permissions; -#endif using System.Runtime.Serialization; namespace System.Reflection { [ComVisible (true)] -#if !NETCORE [ComDefaultInterfaceAttribute (typeof (_Module))] -#endif [Serializable] [ClassInterface(ClassInterfaceType.None)] [StructLayout (LayoutKind.Sequential)] @@ -105,7 +101,7 @@ namespace System.Reflection { public override string FullyQualifiedName { get { -#if !MOBILE && !NETCORE +#if !MOBILE if (SecurityManager.SecurityEnabled) { new FileIOPermission (FileIOPermissionAccess.PathDiscovery, fqname).Demand (); } @@ -199,9 +195,7 @@ namespace System.Reflection { return (globalType != null) ? globalType.GetMethods (bindingFlags) : new MethodInfo [0]; } -#if !NETCORE internal override ModuleHandle GetModuleHandleImpl() => new ModuleHandle (_impl); -#endif public override void GetPEKind (out PortableExecutableKinds peKind, out ImageFileMachine machine) { @@ -320,7 +314,6 @@ namespace System.Reflection { return res; } -#if !NETCORE public override void GetObjectData (SerializationInfo info, StreamingContext context) { if (info == null) @@ -328,9 +321,8 @@ namespace System.Reflection { UnitySerializationHolder.GetUnitySerializationInfo (info, UnitySerializationHolder.ModuleUnity, this.ScopeName, this.GetRuntimeAssembly ()); } -#endif -#if !MOBILE && !NETCORE +#if !MOBILE public override X509Certificate GetSignerCertificate () @@ -365,11 +357,7 @@ namespace System.Reflection { } } -#if NETCORE - internal Guid GetModuleVersionId () -#else internal override Guid GetModuleVersionId () -#endif { var guid = new byte [16]; GetGuidInternal (_impl, guid); diff --git a/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs b/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs index d57fbdecde9..f8404057b85 100644 --- a/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs +++ b/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs @@ -38,12 +38,10 @@ using System.Text; namespace System.Reflection { -#if !NETCORE [ComVisible (true)] [ComDefaultInterfaceAttribute (typeof (_ParameterInfo))] [Serializable] [ClassInterfaceAttribute (ClassInterfaceType.None)] -#endif class RuntimeParameterInfo : ParameterInfo { internal MarshalAsAttribute marshalAs; @@ -255,11 +253,7 @@ namespace System.Reflection attrs [count ++] = new OptionalAttribute (); if (marshalAs != null) { -#if NETCORE - attrs [count ++] = (MarshalAsAttribute)marshalAs.CloneInternal (); -#else attrs [count ++] = marshalAs.Copy (); -#endif } return attrs; diff --git a/mcs/class/corlib/System.Reflection/RuntimePropertyInfo.cs b/mcs/class/corlib/System.Reflection/RuntimePropertyInfo.cs index 65a222522b6..9e64e4b67d6 100644 --- a/mcs/class/corlib/System.Reflection/RuntimePropertyInfo.cs +++ b/mcs/class/corlib/System.Reflection/RuntimePropertyInfo.cs @@ -68,9 +68,7 @@ namespace System.Reflection { [Serializable] [StructLayout (LayoutKind.Sequential)] internal class RuntimePropertyInfo : PropertyInfo -#if !NETCORE , ISerializable -#endif { #pragma warning disable 649 internal IntPtr klass; @@ -90,41 +88,7 @@ namespace System.Reflection { [MethodImplAttribute (MethodImplOptions.InternalCall)] internal static extern object get_default_value (RuntimePropertyInfo prop); - -#if NETCORE - internal BindingFlags BindingFlags { - get { - CachePropertyInfo (PInfo.GetMethod | PInfo.SetMethod); - bool isPublic = info.set_method?.IsPublic == true || info.get_method?.IsPublic == true; - bool isStatic = info.set_method?.IsStatic == true || info.get_method?.IsStatic == true; - bool isInherited = DeclaringType != ReflectedType; - return FilterPreCalculate (isPublic, isInherited, isStatic); - } - } - - // Copied from https://github.com/dotnet/coreclr/blob/7a24a538cd265993e5864179f51781398c28ecdf/src/System.Private.CoreLib/src/System/RtType.cs#L2022 - static BindingFlags FilterPreCalculate (bool isPublic, bool isInherited, bool isStatic) - { - BindingFlags bindingFlags = isPublic ? BindingFlags.Public : BindingFlags.NonPublic; - if (isInherited) { - // We arrange things so the DeclaredOnly flag means "include inherited members" - bindingFlags |= BindingFlags.DeclaredOnly; - if (isStatic) - bindingFlags |= BindingFlags.Static | BindingFlags.FlattenHierarchy; - else - bindingFlags |= BindingFlags.Instance; - } - else { - if (isStatic) - bindingFlags |= BindingFlags.Static; - else - bindingFlags |= BindingFlags.Instance; - } - return bindingFlags; - } -#else internal BindingFlags BindingFlags => 0; -#endif public override Module Module { get { @@ -172,7 +136,6 @@ namespace System.Reflection { } #endregion -#if !NETCORE #region ISerializable Implementation public void GetObjectData(SerializationInfo info, StreamingContext context) { @@ -195,7 +158,6 @@ namespace System.Reflection { return FormatNameAndSig(true); } #endregion -#endif void CachePropertyInfo (PInfo flags) { diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs index 292083a0bf7..068e74e2c51 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs @@ -189,12 +189,10 @@ namespace System.Runtime.CompilerServices return !typeof (T).IsValueType || RuntimeTypeHandle.HasReferences ((typeof (T) as RuntimeType)); } -#if !NETCORE public static object GetUninitializedObject (Type type) { return FormatterServices.GetUninitializedObject (type); } -#endif /// <summary> /// GetSubArray helper method for the compiler to slice an array using a range. diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs index b564f4150d0..7c3b5399b7d 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs @@ -45,7 +45,7 @@ using System.Runtime.InteropServices.ComTypes; using System.Text; using System.Runtime.ConstrainedExecution; -#if !FULL_AOT_RUNTIME && !NETCORE && !DISABLE_REMOTING +#if !FULL_AOT_RUNTIME && !DISABLE_REMOTING using Mono.Interop; #endif @@ -298,7 +298,7 @@ namespace System.Runtime.InteropServices public static object CreateWrapperOfType (object o, Type t) { -#if FULL_AOT_RUNTIME || NETCORE || DISABLE_REMOTING +#if FULL_AOT_RUNTIME || DISABLE_REMOTING throw new PlatformNotSupportedException (); #else __ComObject co = o as __ComObject; @@ -430,7 +430,7 @@ namespace System.Runtime.InteropServices throw new NotImplementedException (); } -#if !MOBILE && !NETCORE +#if !MOBILE [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern static IntPtr GetCCW (object o, Type T); @@ -446,7 +446,7 @@ namespace System.Runtime.InteropServices public static IntPtr GetComInterfaceForObject (object o, Type T) { -#if MOBILE || NETCORE +#if MOBILE throw new PlatformNotSupportedException (); #else IntPtr pItf = GetComInterfaceForObjectInternal (o, T); @@ -456,18 +456,16 @@ namespace System.Runtime.InteropServices } -#if !NETCORE public static IntPtr GetComInterfaceForObject (object o, Type T, CustomQueryInterfaceMode mode) { throw new NotImplementedException (); } -#endif public static IntPtr GetComInterfaceForObject<T, TInterface> (T o) { return GetComInterfaceForObject ((object)o, typeof (T)); } -#if !FULL_AOT_RUNTIME && !NETCORE && !MONOTOUCH +#if !FULL_AOT_RUNTIME && !MONOTOUCH public static IntPtr GetComInterfaceForObjectInContext (object o, Type t) { @@ -622,7 +620,7 @@ namespace System.Runtime.InteropServices public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant) { -#if FULL_AOT_RUNTIME || NETCORE +#if FULL_AOT_RUNTIME throw new PlatformNotSupportedException (); #else Variant vt = new Variant(); @@ -642,7 +640,7 @@ namespace System.Runtime.InteropServices public static object GetObjectForIUnknown (IntPtr pUnk) { -#if MOBILE || FULL_AOT_RUNTIME || NETCORE +#if MOBILE || FULL_AOT_RUNTIME throw new PlatformNotSupportedException (); #else object obj = GetObjectForCCW (pUnk); @@ -657,7 +655,7 @@ namespace System.Runtime.InteropServices public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant) { -#if FULL_AOT_RUNTIME || NETCORE +#if FULL_AOT_RUNTIME throw new PlatformNotSupportedException (); #else Variant vt = (Variant)Marshal.PtrToStructure(pSrcNativeVariant, typeof(Variant)); @@ -667,7 +665,7 @@ namespace System.Runtime.InteropServices public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant) { -#if FULL_AOT_RUNTIME || NETCORE +#if FULL_AOT_RUNTIME throw new PlatformNotSupportedException (); #else Variant vt = (Variant)Marshal.PtrToStructure(pSrcNativeVariant, typeof(Variant)); @@ -677,7 +675,7 @@ namespace System.Runtime.InteropServices public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars) { -#if FULL_AOT_RUNTIME || NETCORE +#if FULL_AOT_RUNTIME throw new PlatformNotSupportedException (); #else if (cVars < 0) @@ -692,7 +690,7 @@ namespace System.Runtime.InteropServices public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars) { -#if FULL_AOT_RUNTIME || NETCORE +#if FULL_AOT_RUNTIME throw new PlatformNotSupportedException (); #else if (cVars < 0) @@ -717,18 +715,15 @@ namespace System.Runtime.InteropServices #if !FULL_AOT_RUNTIME && !MONOTOUCH -#if !NETCORE - [Obsolete ("This method has been deprecated")] public static Thread GetThreadFromFiberCookie (int cookie) { throw new NotImplementedException (); } -#endif public static object GetTypedObjectForIUnknown (IntPtr pUnk, Type t) { -#if NETCORE || DISABLE_REMOTING +#if DISABLE_REMOTING throw new NotImplementedException (); #else ComInteropProxy proxy = new ComInteropProxy (pUnk, t); @@ -749,7 +744,6 @@ namespace System.Runtime.InteropServices throw new NotImplementedException (); } -#if !NETCORE [Obsolete] public static string GetTypeInfoName (UCOMITypeInfo pTI) @@ -763,7 +757,6 @@ namespace System.Runtime.InteropServices { throw new NotImplementedException (); } -#endif public static Guid GetTypeLibGuid (ITypeLib typelib) @@ -777,14 +770,12 @@ namespace System.Runtime.InteropServices throw new NotImplementedException (); } -#if !NETCORE [Obsolete] public static int GetTypeLibLcid (UCOMITypeLib pTLB) { throw new NotImplementedException (); } -#endif public static int GetTypeLibLcid (ITypeLib typelib) @@ -792,14 +783,12 @@ namespace System.Runtime.InteropServices throw new NotImplementedException (); } -#if !NETCORE [Obsolete] public static string GetTypeLibName (UCOMITypeLib pTLB) { throw new NotImplementedException (); } -#endif public static string GetTypeLibName (ITypeLib typelib) @@ -838,12 +827,10 @@ namespace System.Runtime.InteropServices throw new PlatformNotSupportedException (); } -#if !NETCORE public static string GetTypeInfoName (ITypeInfo typeInfo) { throw new PlatformNotSupportedException (); } -#endif public static object GetUniqueObjectForIUnknown (IntPtr unknown) { @@ -1272,9 +1259,6 @@ namespace System.Runtime.InteropServices if (s == null) throw new ArgumentNullException ("s"); -#if NETCORE - return s.MarshalToBSTR (); -#else byte[] buffer = s.GetBuffer (); int len = s.Length; @@ -1289,7 +1273,6 @@ namespace System.Runtime.InteropServices } fixed (byte* fixed_buffer = buffer) return BufferToBSTR ((char*)fixed_buffer, len); -#endif } internal delegate IntPtr SecureStringAllocator(int len); @@ -1309,9 +1292,6 @@ namespace System.Runtime.InteropServices if (s == null) throw new ArgumentNullException ("s"); -#if NETCORE - return s.MarshalToString (false, false); -#else int len = s.Length; IntPtr ctm = allocator (len + 1); byte [] copy = new byte [len+1]; @@ -1334,16 +1314,12 @@ namespace System.Runtime.InteropServices } } return ctm; -#endif } internal static IntPtr SecureStringToUnicode (SecureString s, SecureStringAllocator allocator) { if (s == null) throw new ArgumentNullException ("s"); -#if NETCORE - return s.MarshalToString (false, true); -#else int len = s.Length; IntPtr ctm = allocator (len * 2 + 2); byte [] buffer = null; @@ -1360,8 +1336,6 @@ namespace System.Runtime.InteropServices } } return ctm; -#endif - } public static IntPtr SecureStringToCoTaskMemAnsi (SecureString s) @@ -1378,22 +1352,14 @@ namespace System.Runtime.InteropServices { if (s == null) throw new ArgumentNullException ("s"); -#if NETCORE - return s.MarshalToString (true, false); -#else return SecureStringToAnsi (s, SecureStringGlobalAllocator); -#endif } public static IntPtr SecureStringToGlobalAllocUnicode (SecureString s) { if (s == null) throw new ArgumentNullException ("s"); -#if NETCORE - return s.MarshalToString (true, true); -#else return SecureStringToUnicode (s, SecureStringGlobalAllocator); -#endif } [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)] @@ -1646,9 +1612,6 @@ namespace System.Runtime.InteropServices //const int COR_E_WEAKREFERENCE = unchecked ((int)?); //const int COR_E_VTABLECALLSNOTSUPPORTED = unchecked ((int)); -#if NETCORE - return new COMException ("", errorCode); -#else switch (errorCode) { case MSEE_E_APPDOMAINUNLOADED: return new AppDomainUnloadedException (); @@ -1792,7 +1755,6 @@ namespace System.Runtime.InteropServices if (errorCode < 0) return new COMException ("", errorCode); return null; -#endif } #if FEATURE_COMINTEROP @@ -1939,18 +1901,6 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void SetLastWin32Error (int error); -#if NETCORE - internal static IntPtr AllocBSTR (int length) - { - throw new NotImplementedException (); - } - - internal static bool IsPinnable (object obj) - { - throw new NotImplementedException (); - } -#endif - #if FEATURE_COMINTEROP || MONO_COM // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs //==================================================================== diff --git a/mcs/class/corlib/System.Threading/Monitor.cs b/mcs/class/corlib/System.Threading/Monitor.cs index 3113ce05ba7..7572af26002 100644 --- a/mcs/class/corlib/System.Threading/Monitor.cs +++ b/mcs/class/corlib/System.Threading/Monitor.cs @@ -116,9 +116,5 @@ namespace System.Threading { return Monitor_test_owner (obj); } - -#if NETCORE - public static long LockContentionCount => throw new PlatformNotSupportedException (); -#endif } } diff --git a/mcs/class/corlib/System.Threading/NativeEventCalls.cs b/mcs/class/corlib/System.Threading/NativeEventCalls.cs index 715b51cd307..28b57c640c0 100644 --- a/mcs/class/corlib/System.Threading/NativeEventCalls.cs +++ b/mcs/class/corlib/System.Threading/NativeEventCalls.cs @@ -35,7 +35,7 @@ using System; using System.Runtime.CompilerServices; using Microsoft.Win32.SafeHandles; -#if !MOBILE && !NETCORE +#if !MOBILE using System.Security.AccessControl; using System.IO; #endif @@ -87,7 +87,7 @@ namespace System.Threading [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void CloseEvent_internal (IntPtr handle); -#if !MOBILE && !NETCORE +#if !MOBILE public unsafe static IntPtr OpenEvent_internal (string name, EventWaitHandleRights rights, out int errorCode) { // FIXME check for embedded nuls in name diff --git a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs index 6069bf116d4..62c6078e3e8 100644 --- a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs +++ b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs @@ -84,12 +84,8 @@ namespace System.Threading lock (this) { _unregistered = true; if (_callsInProcess == 0 && _finalEvent != null) { -#if NETCORE - throw new NotImplementedException (); -#else NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle); _finalEvent = null; -#endif } } } catch (ObjectDisposedException) { @@ -112,11 +108,7 @@ namespace System.Threading { _callsInProcess--; if (_unregistered && _callsInProcess == 0 && _finalEvent != null) { -#if NETCORE - EventWaitHandle.Set (_finalEvent.SafeWaitHandle); -#else NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle); -#endif _finalEvent = null; } } diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index 7e2db6cff11..c520115ea1e 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -38,11 +38,9 @@ using System.Security; using System.Diagnostics; using System.Runtime.ConstrainedExecution; -#if !NETCORE using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Remoting.Contexts; using System.Security.Principal; -#endif namespace System.Threading { [StructLayout (LayoutKind.Sequential)] @@ -116,9 +114,7 @@ namespace System.Threading { } [StructLayout (LayoutKind.Sequential)] -#if !NETCORE public -#endif sealed partial class Thread { #pragma warning disable 414 #region Sync with metadata/object-internals.h @@ -164,7 +160,6 @@ namespace System.Threading { [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern static byte[] ByteArrayToCurrentDomain (byte[] arr); -#if !NETCORE #if !DISABLE_REMOTING public static Context CurrentContext { get { @@ -303,7 +298,6 @@ namespace System.Threading { public static AppDomain GetDomain() { return AppDomain.CurrentDomain; } -#endif [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern static void GetCurrentThread_icall (ref Thread thread); diff --git a/mcs/class/corlib/System/ArgIterator.cs b/mcs/class/corlib/System/ArgIterator.cs index 1a9a56d854e..677a0c65b4c 100644 --- a/mcs/class/corlib/System/ArgIterator.cs +++ b/mcs/class/corlib/System/ArgIterator.cs @@ -38,9 +38,6 @@ namespace System { [StructLayout (LayoutKind.Auto)] public -#if NETCORE - ref -#endif struct ArgIterator { #pragma warning disable 169, 414 diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs index 1ab627110a5..b9415e980e0 100644 --- a/mcs/class/corlib/System/Array.cs +++ b/mcs/class/corlib/System/Array.cs @@ -681,20 +681,12 @@ namespace System static int IndexOfImpl<T>(T[] array, T value, int startIndex, int count) { -#if NETCORE - throw new NotImplementedException (); -#else return EqualityComparer<T>.Default.IndexOf (array, value, startIndex, count); -#endif } static int LastIndexOfImpl<T>(T[] array, T value, int startIndex, int count) { -#if NETCORE - throw new NotImplementedException (); -#else return EqualityComparer<T>.Default.LastIndexOf (array, value, startIndex, count); -#endif } static void SortImpl (Array keys, Array items, int index, int length, IComparer comparer) diff --git a/mcs/class/corlib/System/MonoCustomAttrs.cs b/mcs/class/corlib/System/MonoCustomAttrs.cs index 5761df5fa63..7bb4716dad8 100644 --- a/mcs/class/corlib/System/MonoCustomAttrs.cs +++ b/mcs/class/corlib/System/MonoCustomAttrs.cs @@ -154,11 +154,6 @@ namespace System if (attributeType == typeof (MonoCustomAttrs)) attributeType = null; -#if NETCORE - if (attributeType == typeof (Attribute)) - attributeType = null; -#endif - object[] r; object[] res = GetCustomAttributesBase (obj, attributeType, false); // shortcut diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs index 50f312941a4..6a67652037b 100644 --- a/mcs/class/corlib/System/MulticastDelegate.cs +++ b/mcs/class/corlib/System/MulticastDelegate.cs @@ -286,12 +286,5 @@ namespace System return !d1.Equals (d2); } - -#if NETCORE - internal override object GetTarget() - { - return delegates?.Length > 0 ? delegates [delegates.Length - 1].GetTarget () : base.GetTarget (); - } -#endif } } diff --git a/mcs/class/corlib/System/RuntimeTypeHandle.cs b/mcs/class/corlib/System/RuntimeTypeHandle.cs index c308ba2e487..a9322eabe61 100644 --- a/mcs/class/corlib/System/RuntimeTypeHandle.cs +++ b/mcs/class/corlib/System/RuntimeTypeHandle.cs @@ -224,11 +224,7 @@ namespace System internal static bool IsContextful (RuntimeType type) { -#if NETCORE - return false; -#else return typeof (ContextBoundObject).IsAssignableFrom (type); -#endif } internal static bool IsEquivalentTo (RuntimeType rtType1, RuntimeType rtType2) |