From: Rodrigo Kumpera Date: Thu, 9 Apr 2015 22:04:38 +0000 (-0500) Subject: Merge pull request #1698 from ludovic-henry/socket-reorg-2 X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=a95ec1f5bcbe1f71b3bb59b6296936ae5375d33c;hp=52d761a1f61fc3c721285df87bfe99314117aff3;p=mono.git Merge pull request #1698 from ludovic-henry/socket-reorg-2 Reorganize Socket code --- diff --git a/README.md b/README.md index 36a9c1ef398..0a8bf7c1a9d 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ Officially supported architectures: Community supported architectures: -| debian-ppc64el | centos-s390x | -|-----------------------------|---------------------------| -| [![debian-ppc64el][11]][12] | [![centos-s390x][13]][14] | +| centos-s390x | +|---------------------------| +| [![centos-s390x][11]][12] | [1]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/badge/icon [2]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/ @@ -35,10 +35,8 @@ Community supported architectures: [8]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/ [9]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true [10]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master -[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=debian-ppc64el/badge/icon -[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=debian-ppc64el/ -[13]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=centos-s390x/badge/icon -[14]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=centos-s390x/ +[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/badge/icon +[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/ Compilation and Installation ============================ @@ -145,13 +143,6 @@ runtime as an embedded library. * `scripts/` - Scripts used to invoke Mono and the corresponding program. -* `../olive/` - Incubation code from [Olive](https://github.com/mono/olive). - - * If the directory ../olive is present (as an -independent checkout) from the Mono module, that -directory is automatically configured to share the -same prefix than this module gets. - Contributing to Mono ==================== diff --git a/configure.ac b/configure.ac index 7a4803a3f69..6b2634e8aa8 100644 --- a/configure.ac +++ b/configure.ac @@ -102,14 +102,11 @@ case "$host" in host_win32=yes mono_cv_clang=no if test "x$cross_compiling" = "xno"; then - target_win32=yes if test "x$host" == "x$build" -a "x$host" == "x$target"; then - AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32]) + target_win32=yes fi else target_win32=yes - AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32/MinGW]) - AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW]) fi HOST_CC="gcc" # Windows XP SP2 is required @@ -631,17 +628,6 @@ fi AC_SUBST([mcs_topdir]) AC_SUBST([mcs_topdir_from_srcdir]) -# Where's the 'olive' source tree? -if test -d $srcdir/olive; then - olivedir=olive -else - olivedir=../olive -fi - -if test -d $srcdir/$olivedir; then -olive_topdir='$(top_srcdir)/'$olivedir -fi - # gettext: prepare the translation directories. # we do not configure the full gettext, as we consume it dynamically from C# AM_PO_SUBDIRS @@ -3072,6 +3058,7 @@ if test "x$host" != "x$target"; then # in mono-compiler.h with_tls=pthread target_mach=no + target_win32=no ;; aarch64*-linux-*) TARGET=ARM64; @@ -4029,22 +4016,6 @@ fi fi - # if we have an olive folder, override the default settings - if test -d $olivedir; then - - if test x$cross_compiling = xno && test x$enable_olive_build != xno; then - - test -w $srcdir/$olivedir/build || chmod +w $srcdir/$olivedir/build - - echo "prefix=$prefix" > $srcdir/$olivedir/build/config.make - echo "exec_prefix=$exec_prefix" >> $srcdir/$olivedir/build/config.make - echo 'mono_libdir=${exec_prefix}/lib' >> $srcdir/$olivedir/build/config.make - echo 'MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)' >> $srcdir/$olivedir/build/config.make - echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $srcdir/$olivedir/build/config.make - echo "MONO_VERSION = $myver" >> $srcdir/$olivedir/build/config.make - fi - fi - ) libgdiplus_msg=${libgdiplus_loc:-assumed to be installed} diff --git a/docs/Makefile.am b/docs/Makefile.am index 5eb42044614..9c514420403 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -46,7 +46,6 @@ EXTRA_DIST = \ public \ public-api \ README \ - release-notes-1.0.html \ remoting \ ssapre.txt \ stack-overflow.txt \ diff --git a/external/referencesource b/external/referencesource index dc94cc0420c..0b8d054523f 160000 --- a/external/referencesource +++ b/external/referencesource @@ -1 +1 @@ -Subproject commit dc94cc0420ceea51363b1d622f075e502980c2f0 +Subproject commit 0b8d054523f1e88a057cd4cbf1fe808afc3e361d diff --git a/man/mcs.1 b/man/mcs.1 index 14221a83c10..a193f9f0850 100644 --- a/man/mcs.1 +++ b/man/mcs.1 @@ -249,29 +249,6 @@ This will instruct the compiler to reference the System.* libraries available on a typical dotnet framework installation, notice that this does not include all of the Mono libraries, only the System.* ones. This is a convenient shortcut for those porting code. -.TP -.I \-pkg:olive -Use this to reference the "Olive" libraries (the 3.0 and 3.5 extended -libraries). -.TP -.I \-pkg:silver -References the assemblies for creating Moonlight/Silverlight -applications. -.TP -.I \-pkg:silverdesktop -Use this option to create Moonlight/Silverlight applications that -target the desktop. This option allows developers to consume the -Silverlight APIs with the full 2.0 profile API available to them, -unlike -.I smcs -it gives full access to all the APIs that are part of Mono. The only -downside is that applications created with silverdesktop will not run -on the browser. Typically these applications will be launched -with the -.I mopen -command line tool. -.TP -For more details see the PACKAGE section in this document .ne .RE .TP diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile index e41af0d03f3..42ae018b29b 100644 --- a/mcs/class/corlib/Makefile +++ b/mcs/class/corlib/Makefile @@ -36,12 +36,12 @@ RESOURCE_FILES = \ resources/collation.cjkKO.bin \ resources/collation.cjkKOlv2.bin -REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID +REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE)) ifndef MOBILE_STATIC -REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING,MONO_COM,FEATURE_FUSION +REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING,MONO_COM endif LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS) diff --git a/mcs/class/corlib/ReferenceSources/Buffer.cs b/mcs/class/corlib/ReferenceSources/Buffer.cs new file mode 100644 index 00000000000..94b3a955269 --- /dev/null +++ b/mcs/class/corlib/ReferenceSources/Buffer.cs @@ -0,0 +1,176 @@ +namespace System +{ + partial class Buffer + { + public static int ByteLength (Array array) + { + // note: the other methods in this class also use ByteLength to test for + // null and non-primitive arguments as a side-effect. + + if (array == null) + throw new ArgumentNullException ("array"); + + int length = _ByteLength (array); + if (length < 0) + throw new ArgumentException (Locale.GetText ("Object must be an array of primitives.")); + + return length; + } + + public static byte GetByte (Array array, int index) + { + if (index < 0 || index >= ByteLength (array)) + throw new ArgumentOutOfRangeException ("index"); + + return _GetByte (array, index); + } + + public static void SetByte (Array array, int index, byte value) + { + if (index < 0 || index >= ByteLength (array)) + throw new ArgumentOutOfRangeException ("index"); + + _SetByte (array, index, value); + } + + public static void BlockCopy (Array src, int srcOffset, Array dst, int dstOffset, int count) + { + if (src == null) + throw new ArgumentNullException ("src"); + + if (dst == null) + throw new ArgumentNullException ("dst"); + + if (srcOffset < 0) + throw new ArgumentOutOfRangeException ("srcOffset", Locale.GetText( + "Non-negative number required.")); + + if (dstOffset < 0) + throw new ArgumentOutOfRangeException ("dstOffset", Locale.GetText ( + "Non-negative number required.")); + + if (count < 0) + throw new ArgumentOutOfRangeException ("count", Locale.GetText ( + "Non-negative number required.")); + + // We do the checks in unmanaged code for performance reasons + bool res = InternalBlockCopy (src, srcOffset, dst, dstOffset, count); + if (!res) { + // watch for integer overflow + if ((srcOffset > ByteLength (src) - count) || (dstOffset > ByteLength (dst) - count)) + throw new ArgumentException (Locale.GetText ( + "Offset and length were out of bounds for the array or count is greater than " + + "the number of elements from index to the end of the source collection.")); + } + } + + internal static unsafe void memcpy4 (byte *dest, byte *src, int size) { + /*while (size >= 32) { + // using long is better than int and slower than double + // FIXME: enable this only on correct alignment or on platforms + // that can tolerate unaligned reads/writes of doubles + ((double*)dest) [0] = ((double*)src) [0]; + ((double*)dest) [1] = ((double*)src) [1]; + ((double*)dest) [2] = ((double*)src) [2]; + ((double*)dest) [3] = ((double*)src) [3]; + dest += 32; + src += 32; + size -= 32; + }*/ + while (size >= 16) { + ((int*)dest) [0] = ((int*)src) [0]; + ((int*)dest) [1] = ((int*)src) [1]; + ((int*)dest) [2] = ((int*)src) [2]; + ((int*)dest) [3] = ((int*)src) [3]; + dest += 16; + src += 16; + size -= 16; + } + while (size >= 4) { + ((int*)dest) [0] = ((int*)src) [0]; + dest += 4; + src += 4; + size -= 4; + } + while (size > 0) { + ((byte*)dest) [0] = ((byte*)src) [0]; + dest += 1; + src += 1; + --size; + } + } + internal static unsafe void memcpy2 (byte *dest, byte *src, int size) { + while (size >= 8) { + ((short*)dest) [0] = ((short*)src) [0]; + ((short*)dest) [1] = ((short*)src) [1]; + ((short*)dest) [2] = ((short*)src) [2]; + ((short*)dest) [3] = ((short*)src) [3]; + dest += 8; + src += 8; + size -= 8; + } + while (size >= 2) { + ((short*)dest) [0] = ((short*)src) [0]; + dest += 2; + src += 2; + size -= 2; + } + if (size > 0) + ((byte*)dest) [0] = ((byte*)src) [0]; + } + static unsafe void memcpy1 (byte *dest, byte *src, int size) { + while (size >= 8) { + ((byte*)dest) [0] = ((byte*)src) [0]; + ((byte*)dest) [1] = ((byte*)src) [1]; + ((byte*)dest) [2] = ((byte*)src) [2]; + ((byte*)dest) [3] = ((byte*)src) [3]; + ((byte*)dest) [4] = ((byte*)src) [4]; + ((byte*)dest) [5] = ((byte*)src) [5]; + ((byte*)dest) [6] = ((byte*)src) [6]; + ((byte*)dest) [7] = ((byte*)src) [7]; + dest += 8; + src += 8; + size -= 8; + } + while (size >= 2) { + ((byte*)dest) [0] = ((byte*)src) [0]; + ((byte*)dest) [1] = ((byte*)src) [1]; + dest += 2; + src += 2; + size -= 2; + } + if (size > 0) + ((byte*)dest) [0] = ((byte*)src) [0]; + } + + internal static unsafe void Memcpy (byte *dest, byte *src, int size) { + // FIXME: if pointers are not aligned, try to align them + // so a faster routine can be used. Handle the case where + // the pointers can't be reduced to have the same alignment + // (just ignore the issue on x86?) + if ((((int)dest | (int)src) & 3) != 0) { + if (((int)dest & 1) != 0 && ((int)src & 1) != 0 && size >= 1) { + dest [0] = src [0]; + ++dest; + ++src; + --size; + } + if (((int)dest & 2) != 0 && ((int)src & 2) != 0 && size >= 2) { + ((short*)dest) [0] = ((short*)src) [0]; + dest += 2; + src += 2; + size -= 2; + } + if ((((int)dest | (int)src) & 1) != 0) { + memcpy1 (dest, src, size); + return; + } + if ((((int)dest | (int)src) & 2) != 0) { + memcpy2 (dest, src, size); + return; + } + } + memcpy4 (dest, src, size); + } + } +} \ No newline at end of file diff --git a/mcs/class/corlib/ReferenceSources/JitHelpers.cs b/mcs/class/corlib/ReferenceSources/JitHelpers.cs index 05c4d716cc1..d5d822fdb00 100644 --- a/mcs/class/corlib/ReferenceSources/JitHelpers.cs +++ b/mcs/class/corlib/ReferenceSources/JitHelpers.cs @@ -6,7 +6,17 @@ namespace System.Runtime.CompilerServices { { static internal T UnsafeCast(Object o) where T : class { - return (T)o; + return Array.UnsafeMov (o); + } + + static internal int UnsafeEnumCast(T val) where T : struct + { + return Array.UnsafeMov (val); + } + + static internal long UnsafeEnumCastLong(T val) where T : struct + { + throw new NotImplementedException (); } } } \ No newline at end of file diff --git a/mcs/class/corlib/ReferenceSources/RuntimeType.cs b/mcs/class/corlib/ReferenceSources/RuntimeType.cs index 3557e77817c..9dd5e9c6ad0 100644 --- a/mcs/class/corlib/ReferenceSources/RuntimeType.cs +++ b/mcs/class/corlib/ReferenceSources/RuntimeType.cs @@ -394,42 +394,11 @@ namespace System return constraints; } - public override Type MakeGenericType (params Type[] typeArguments) + internal static object CreateInstanceForAnotherGenericParameter (Type genericType, RuntimeType genericArgument) { - if (IsUserType) - throw new NotSupportedException (); - if (!IsGenericTypeDefinition) - throw new InvalidOperationException ("not a generic type definition"); - if (typeArguments == null) - throw new ArgumentNullException ("typeArguments"); - if (GetGenericArguments().Length != typeArguments.Length) - throw new ArgumentException (String.Format ("The type or method has {0} generic parameter(s) but {1} generic argument(s) where provided. A generic argument must be provided for each generic parameter.", GetGenericArguments ().Length, typeArguments.Length), "typeArguments"); - - bool hasUserType = false; - - Type[] systemTypes = new Type[typeArguments.Length]; - for (int i = 0; i < typeArguments.Length; ++i) { - Type t = typeArguments [i]; - if (t == null) - throw new ArgumentNullException ("typeArguments"); - - if (!(t is MonoType)) - hasUserType = true; - systemTypes [i] = t; - } - - if (hasUserType) { -#if FULL_AOT_RUNTIME - throw new NotSupportedException ("User types are not supported under full aot"); -#else - return new MonoGenericClass (this, typeArguments); -#endif - } - - Type res = MakeGenericType (this, systemTypes); - if (res == null) - throw new TypeLoadException (); - return res; + var gt = (RuntimeType) MakeGenericType (genericType, new Type [] { genericArgument }); + var ctor = gt.GetDefaultConstructor (); + return ctor.InternalInvoke (null, null); } [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -612,7 +581,7 @@ namespace System internal extern string getFullName(bool full_name, bool assembly_qualified); [MethodImplAttribute(MethodImplOptions.InternalCall)] - public extern override Type [] GetGenericArguments (); + extern Type[] GetGenericArgumentsInternal (bool runtimeArray); [MethodImplAttribute(MethodImplOptions.InternalCall)] extern GenericParameterAttributes GetGenericParameterAttributes (); diff --git a/mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs b/mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs deleted file mode 100644 index 50ce810a716..00000000000 --- a/mcs/class/corlib/ReferenceSources/TimeZoneInfoOptions.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System -{ - [Flags] - internal enum TimeZoneInfoOptions { - None = 1, - NoThrowOnInvalidTime = 2 - }; -} \ No newline at end of file diff --git a/mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs b/mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs new file mode 100644 index 00000000000..9e826646321 --- /dev/null +++ b/mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs @@ -0,0 +1,14 @@ +namespace System.Reflection.Emit +{ + abstract class TypeBuilderInstantiation : TypeInfo + { + internal static Type MakeGenericType (Type type, Type[] typeArguments) + { +#if FULL_AOT_RUNTIME + throw new NotSupportedException ("User types are not supported under full aot"); +#else + return new MonoGenericClass (type, typeArguments); +#endif + } + } +} \ No newline at end of file diff --git a/mcs/class/corlib/System.Collections.Generic/Comparer.cs b/mcs/class/corlib/System.Collections.Generic/Comparer.cs deleted file mode 100644 index d19ce2cc8bb..00000000000 --- a/mcs/class/corlib/System.Collections.Generic/Comparer.cs +++ /dev/null @@ -1,126 +0,0 @@ -// -// Comparer.cs -// -// Authors: -// Ben Maurer (bmaurer@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Runtime.InteropServices; - -namespace System.Collections.Generic { - [Serializable] - public abstract class Comparer : IComparer, IComparer - { - static readonly Comparer _default = typeof (IComparable).IsAssignableFrom (typeof (T)) ? - (Comparer) Activator.CreateInstance (typeof (GenericComparer <>).MakeGenericType (typeof (T))) : - new DefaultComparer (); - - public abstract int Compare (T x, T y); - - public static Comparer Default { - get { - return _default; - } - } - - public static Comparer Create (Comparison comparison) - { - if (comparison == null) - throw new ArgumentNullException ("comparison"); - - return new ComparisonComparer (comparison); - } - - int IComparer.Compare (object x, object y) - { - if (x == y) - return 0; - if (x == null) - return y == null ? 0 : -1; - if (y == null) - return 1; - - if (x is T && y is T) - return Compare ((T) x, (T) y); - - throw new ArgumentException (); - } - - [Serializable] - sealed class DefaultComparer : Comparer - { - public override int Compare (T x, T y) - { - // `null' is less than any other ref type - if (x == null) - return y == null ? 0 : -1; - if (y == null) - return 1; - - var i = x as IComparable; - if (i != null) - return i.CompareTo (y); - - i = y as IComparable; - if (i != null) - return -i.CompareTo (x); - - throw new ArgumentException ("At least one argument has to implement IComparable interface"); - } - } - } - - [Serializable] - sealed class GenericComparer : Comparer where T : IComparable - { - public override int Compare (T x, T y) - { - // `null' is less than any other ref type - if (x == null) - return y == null ? 0 : -1; - if (y == null) - return 1; - - return x.CompareTo (y); - } - } - [Serializable] - sealed class ComparisonComparer : Comparer - { - readonly Comparison comparison; - - public ComparisonComparer (Comparison comparison) - { - this.comparison = comparison; - } - - public override int Compare (T x, T y) - { - return comparison (x, y); - } - } -} diff --git a/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs b/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs deleted file mode 100644 index 9338f966f50..00000000000 --- a/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs +++ /dev/null @@ -1,229 +0,0 @@ -// -// EqualityComparer.cs -// -// Authors: -// Ben Maurer (bmaurer@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Runtime.InteropServices; - -namespace System.Collections.Generic { - [Serializable] - public abstract class EqualityComparer : IEqualityComparer, IEqualityComparer { - - static EqualityComparer () - { - var t = typeof (T); - if (t == typeof (string)) { - _default = (EqualityComparer) (object) new InternalStringComparer (); - return; - } - - if (t == typeof (int)) { - _default = (EqualityComparer) (object) new IntEqualityComparer (); - return; - } - - if (t.IsEnum && Enum.GetUnderlyingType (t) == typeof (int)) { - _default = new EnumIntEqualityComparer (); - return; - } - - if (typeof (IEquatable ).IsAssignableFrom (t)) - _default = (EqualityComparer ) Activator.CreateInstance (typeof (GenericEqualityComparer <>).MakeGenericType (t)); - else - _default = new DefaultComparer (); - } - - public abstract int GetHashCode (T obj); - public abstract bool Equals (T x, T y); - - static readonly EqualityComparer _default; - - public static EqualityComparer Default { - get { - return _default; - } - } - - int IEqualityComparer.GetHashCode (object obj) - { - if (obj == null) - return 0; - - if (!(obj is T)) - throw new ArgumentException ("Argument is not compatible", "obj"); - - return GetHashCode ((T)obj); - } - - bool IEqualityComparer.Equals (object x, object y) - { - if (x == y) - return true; - - if (x == null || y == null) - return false; - - if (!(x is T)) - throw new ArgumentException ("Argument is not compatible", "x"); - if (!(y is T)) - throw new ArgumentException ("Argument is not compatible", "y"); - return Equals ((T)x, (T)y); - } - - internal virtual int IndexOf (T[] array, T value, int startIndex, int endIndex) - { - for (int i = startIndex; i < endIndex; ++i) { - if (Equals (Array.UnsafeLoad (array, i), value)) - return i; - } - - return -1; - } - } - - [Serializable] - sealed class DefaultComparer : EqualityComparer { - - public override int GetHashCode (T obj) - { - if (obj == null) - return 0; - return obj.GetHashCode (); - } - - public override bool Equals (T x, T y) - { - if (x == null) - return y == null; - - return x.Equals (y); - } - } - - [Serializable] - sealed class InternalStringComparer : EqualityComparer { - - public override int GetHashCode (string obj) - { - if (obj == null) - return 0; - return obj.GetHashCode (); - } - - public override bool Equals (string x, string y) - { - if (x == null) - return y == null; - - if ((object) x == (object) y) - return true; - - return x.Equals (y); - } - - internal override int IndexOf (string[] array, string value, int startIndex, int endIndex) - { - for (int i = startIndex; i < endIndex; ++i) { - if (Array.UnsafeLoad (array, i) == value) - return i; - } - - return -1; - } - } - - [Serializable] - sealed class IntEqualityComparer : EqualityComparer - { - public override int GetHashCode (int obj) - { - return obj; - } - - public override bool Equals (int x, int y) - { - return x == y; - } - - internal override int IndexOf (int[] array, int value, int startIndex, int endIndex) - { - for (int i = startIndex; i < endIndex; ++i) { - if (Array.UnsafeLoad (array, i) == value) - return i; - } - - return -1; - } - } - - [Serializable] - sealed class EnumIntEqualityComparer : EqualityComparer - { - public override int GetHashCode (T obj) - { - return Array.UnsafeMov (obj); - } - - public override bool Equals (T x, T y) - { - return Array.UnsafeMov (x) == Array.UnsafeMov (y); - } - - internal override int IndexOf (T[] array, T value, int startIndex, int endIndex) - { - int v = Array.UnsafeMov (value); - var a = Array.UnsafeMov (array); - for (int i = startIndex; i < endIndex; ++i) { - if (Array.UnsafeLoad (a, i) == v) - return i; - } - - return -1; - } - } - - [Serializable] - sealed class GenericEqualityComparer : EqualityComparer where T : IEquatable { - - public override int GetHashCode (T obj) - { - if (obj == null) - return 0; - return obj.GetHashCode (); - } - - public override bool Equals (T x, T y) - { - if (x == null) - return y == null; - - return x.Equals (y); - } - } -} diff --git a/mcs/class/corlib/System.IO/FileStream.cs b/mcs/class/corlib/System.IO/FileStream.cs index 1cc5364dfd5..610247d2e08 100644 --- a/mcs/class/corlib/System.IO/FileStream.cs +++ b/mcs/class/corlib/System.IO/FileStream.cs @@ -988,7 +988,7 @@ namespace System.IO if (count > 0) { // Use the fastest method, all range checks has been done - Buffer.BlockCopyInternal (buf, buf_offset, dest, dest_offset, count); + Buffer.InternalBlockCopy (buf, buf_offset, dest, dest_offset, count); buf_offset += count; } diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs index 3dcdce4733e..7b8c0dfd920 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs @@ -150,7 +150,13 @@ namespace System.Runtime.Remoting.Contexts { return rp.ObjectIdentity.ClientDynamicProperties; } else + { +#if FEATURE_REMOTING return obj.ObjectIdentity.ServerDynamicProperties; +#else + throw new NotSupportedException (); +#endif + } } else if (ctx != null && obj == null) { diff --git a/mcs/class/corlib/System/Action.cs b/mcs/class/corlib/System/Action.cs deleted file mode 100644 index 438f7fc31d2..00000000000 --- a/mcs/class/corlib/System/Action.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// Action.cs -// -// Authors: -// Ben Maurer (bmaurer@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// Copyright (C) 2004, 2010 Novell -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Runtime.CompilerServices; - -namespace System -{ -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate void Action (); - - public delegate void Action (T obj); - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate void Action (T1 arg1, T2 arg2); - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate void Action (T1 arg1, T2 arg2, T3 arg3); - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate void Action (T1 arg1, T2 arg2, T3 arg3, T4 arg4); - - public delegate void Action (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5); - public delegate void Action (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6); - public delegate void Action (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7); - public delegate void Action (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8); -} diff --git a/mcs/class/corlib/System/ApplicationId.cs b/mcs/class/corlib/System/ApplicationId.cs deleted file mode 100644 index b8675911fc3..00000000000 --- a/mcs/class/corlib/System/ApplicationId.cs +++ /dev/null @@ -1,138 +0,0 @@ -// -// System.ApplicationId class -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Runtime.InteropServices; -using System.Text; - -namespace System { - - [Serializable] - [ComVisible (true)] - public sealed class ApplicationId { - - private byte[] _token; - private string _name; - private Version _version; - private string _proc; - private string _culture; - - public ApplicationId (byte[] publicKeyToken, string name, Version version, string processorArchitecture, string culture) - { - if (publicKeyToken == null) - throw new ArgumentNullException ("publicKeyToken"); - if (name == null) - throw new ArgumentNullException ("name"); - if (version == null) - throw new ArgumentNullException ("version"); - - _token = (byte[]) publicKeyToken.Clone (); - _name = name; - _version = version; - _proc = processorArchitecture; - _culture = culture; - } - - // properties - - public string Culture { - get { return _culture; } - } - - public string Name { - get { return _name; } - } - - public string ProcessorArchitecture { - get { return _proc; } - } - - public byte[] PublicKeyToken { - get { return (byte[]) _token.Clone (); } - } - - public Version Version { - get { return _version; } - } - - // methods - - public ApplicationId Copy () - { - return new ApplicationId (_token, _name, _version, _proc, _culture); - } - - public override bool Equals (object o) - { - if (o == null) - return false; - ApplicationId appid = (o as ApplicationId); - if (appid == null) - return false; - if (_name != appid._name) - return false; - if (_proc != appid._proc) - return false; - if (_culture != appid._culture) - return false; - if (!_version.Equals (appid._version)) - return false; - if (_token.Length != appid._token.Length) - return false; - for (int i=0; i < _token.Length; i++) - if (_token [i] != appid._token [i]) - return false; - return true; - } - - public override int GetHashCode () - { - int code = _name.GetHashCode () ^ _version.GetHashCode (); - for (int i=0; i < _token.Length; i++) - code ^= _token [i]; - // ProcessorArchitecture and Culture aren't part of the hash code - // Confirmed by Microsoft in FDBK13339 - return code; - } - - public override string ToString () - { - StringBuilder sb = new StringBuilder (); - sb.Append (_name); - if (_culture != null) - sb.AppendFormat (", culture=\"{0}\"", _culture); - sb.AppendFormat (", version=\"{0}\", publicKeyToken=\"", _version); - for (int i=0; i < _token.Length; i++) - sb.Append (_token [i].ToString ("X2")); - if (_proc != null) - sb.AppendFormat ("\", processorArchitecture =\"{0}\"", _proc); - else - sb.Append ("\""); - return sb.ToString (); - } - } -} diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs index b4afbe2eb84..9c263400572 100644 --- a/mcs/class/corlib/System/Array.cs +++ b/mcs/class/corlib/System/Array.cs @@ -3045,7 +3045,7 @@ namespace System if (count < 0 || startIndex < array.GetLowerBound (0) || startIndex - 1 > array.GetUpperBound (0) - count) throw new ArgumentOutOfRangeException (); - return EqualityComparer.Default.IndexOf (array, value, startIndex, startIndex + count); + return EqualityComparer.Default.IndexOf (array, value, startIndex, count); } public static int LastIndexOf (T [] array, T value) diff --git a/mcs/class/corlib/System/AsyncCallback.cs b/mcs/class/corlib/System/AsyncCallback.cs deleted file mode 100644 index 3f2bf733cb6..00000000000 --- a/mcs/class/corlib/System/AsyncCallback.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.AsyncCallback.cs -// -// Author: -// Paolo Molaro (lupus@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System -{ - [System.Runtime.InteropServices.ComVisible (true)] - [Serializable] - public delegate void AsyncCallback (IAsyncResult ar); -} diff --git a/mcs/class/corlib/System/Buffer.cs b/mcs/class/corlib/System/Buffer.cs deleted file mode 100644 index 3f4960d7b79..00000000000 --- a/mcs/class/corlib/System/Buffer.cs +++ /dev/null @@ -1,264 +0,0 @@ -// -// System.Buffer.cs -// -// Authors: -// Paolo Molaro (lupus@ximian.com) -// Dan Lewis (dihlewis@yahoo.co.uk) -// -// (C) 2001 Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Diagnostics.Contracts; - -namespace System { - [ComVisible (true)] - public static class Buffer { - - public static int ByteLength (Array array) - { - // note: the other methods in this class also use ByteLength to test for - // null and non-primitive arguments as a side-effect. - - if (array == null) - throw new ArgumentNullException ("array"); - - int length = ByteLengthInternal (array); - if (length < 0) - throw new ArgumentException (Locale.GetText ("Object must be an array of primitives.")); - - return length; - } - - public static byte GetByte (Array array, int index) - { - if (index < 0 || index >= ByteLength (array)) - throw new ArgumentOutOfRangeException ("index", Locale.GetText( - "Value must be non-negative and less than the size of the collection.")); - - return GetByteInternal (array, index); - } - - public static void SetByte (Array array, int index, byte value) - { - if (index < 0 || index >= ByteLength (array)) - throw new ArgumentOutOfRangeException ("index", Locale.GetText( - "Value must be non-negative and less than the size of the collection.")); - - SetByteInternal (array, index, value); - } - - public static void BlockCopy (Array src, int srcOffset, Array dst, int dstOffset, int count) - { - if (src == null) - throw new ArgumentNullException ("src"); - - if (dst == null) - throw new ArgumentNullException ("dst"); - - if (srcOffset < 0) - throw new ArgumentOutOfRangeException ("srcOffset", Locale.GetText( - "Non-negative number required.")); - - if (dstOffset < 0) - throw new ArgumentOutOfRangeException ("dstOffset", Locale.GetText ( - "Non-negative number required.")); - - if (count < 0) - throw new ArgumentOutOfRangeException ("count", Locale.GetText ( - "Non-negative number required.")); - - // We do the checks in unmanaged code for performance reasons - bool res = BlockCopyInternal (src, srcOffset, dst, dstOffset, count); - if (!res) { - // watch for integer overflow - if ((srcOffset > ByteLength (src) - count) || (dstOffset > ByteLength (dst) - count)) - throw new ArgumentException (Locale.GetText ( - "Offset and length were out of bounds for the array or count is greater than " + - "the number of elements from index to the end of the source collection.")); - } - } - - // private - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern static int ByteLengthInternal (Array array); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern static byte GetByteInternal (Array array, int index); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - private extern static void SetByteInternal (Array array, int index, int value); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - internal extern static bool BlockCopyInternal (Array src, int src_offset, Array dest, int dest_offset, int count); - - internal static bool InternalBlockCopy (Array src, int src_offset, Array dest, int dest_offset, int count) - { - return BlockCopyInternal (src, src_offset, dest, dest_offset, count); - } - - internal unsafe static void ZeroMemory (byte* src, long len) - { - while(len-- > 0) - *(src + len) = 0; - } - - internal unsafe static void Memcpy (byte* pDest, int destIndex, byte[] src, int srcIndex, int len) - { - Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); - Contract.Assert(src.Length - srcIndex >= len, "not enough bytes in src"); - // If dest has 0 elements, the fixed statement will throw an - // IndexOutOfRangeException. Special-case 0-byte copies. - if (len==0) - return; - fixed(byte* pSrc = src) { - Memcpy(pDest + destIndex, pSrc + srcIndex, len); - } - } - - internal unsafe static void Memcpy(byte[] dest, int destIndex, byte* src, int srcIndex, int len) { - Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); - Contract.Assert(dest.Length - destIndex >= len, "not enough bytes in dest"); - // If dest has 0 elements, the fixed statement will throw an - // IndexOutOfRangeException. Special-case 0-byte copies. - if (len==0) - return; - fixed(byte* pDest = dest) { - Memcpy(pDest + destIndex, src + srcIndex, len); - } - } - - internal static unsafe void memcpy4 (byte *dest, byte *src, int size) { - /*while (size >= 32) { - // using long is better than int and slower than double - // FIXME: enable this only on correct alignment or on platforms - // that can tolerate unaligned reads/writes of doubles - ((double*)dest) [0] = ((double*)src) [0]; - ((double*)dest) [1] = ((double*)src) [1]; - ((double*)dest) [2] = ((double*)src) [2]; - ((double*)dest) [3] = ((double*)src) [3]; - dest += 32; - src += 32; - size -= 32; - }*/ - while (size >= 16) { - ((int*)dest) [0] = ((int*)src) [0]; - ((int*)dest) [1] = ((int*)src) [1]; - ((int*)dest) [2] = ((int*)src) [2]; - ((int*)dest) [3] = ((int*)src) [3]; - dest += 16; - src += 16; - size -= 16; - } - while (size >= 4) { - ((int*)dest) [0] = ((int*)src) [0]; - dest += 4; - src += 4; - size -= 4; - } - while (size > 0) { - ((byte*)dest) [0] = ((byte*)src) [0]; - dest += 1; - src += 1; - --size; - } - } - internal static unsafe void memcpy2 (byte *dest, byte *src, int size) { - while (size >= 8) { - ((short*)dest) [0] = ((short*)src) [0]; - ((short*)dest) [1] = ((short*)src) [1]; - ((short*)dest) [2] = ((short*)src) [2]; - ((short*)dest) [3] = ((short*)src) [3]; - dest += 8; - src += 8; - size -= 8; - } - while (size >= 2) { - ((short*)dest) [0] = ((short*)src) [0]; - dest += 2; - src += 2; - size -= 2; - } - if (size > 0) - ((byte*)dest) [0] = ((byte*)src) [0]; - } - static unsafe void memcpy1 (byte *dest, byte *src, int size) { - while (size >= 8) { - ((byte*)dest) [0] = ((byte*)src) [0]; - ((byte*)dest) [1] = ((byte*)src) [1]; - ((byte*)dest) [2] = ((byte*)src) [2]; - ((byte*)dest) [3] = ((byte*)src) [3]; - ((byte*)dest) [4] = ((byte*)src) [4]; - ((byte*)dest) [5] = ((byte*)src) [5]; - ((byte*)dest) [6] = ((byte*)src) [6]; - ((byte*)dest) [7] = ((byte*)src) [7]; - dest += 8; - src += 8; - size -= 8; - } - while (size >= 2) { - ((byte*)dest) [0] = ((byte*)src) [0]; - ((byte*)dest) [1] = ((byte*)src) [1]; - dest += 2; - src += 2; - size -= 2; - } - if (size > 0) - ((byte*)dest) [0] = ((byte*)src) [0]; - } - - internal static unsafe void Memcpy (byte *dest, byte *src, int size) { - // FIXME: if pointers are not aligned, try to align them - // so a faster routine can be used. Handle the case where - // the pointers can't be reduced to have the same alignment - // (just ignore the issue on x86?) - if ((((int)dest | (int)src) & 3) != 0) { - if (((int)dest & 1) != 0 && ((int)src & 1) != 0 && size >= 1) { - dest [0] = src [0]; - ++dest; - ++src; - --size; - } - if (((int)dest & 2) != 0 && ((int)src & 2) != 0 && size >= 2) { - ((short*)dest) [0] = ((short*)src) [0]; - dest += 2; - src += 2; - size -= 2; - } - if ((((int)dest | (int)src) & 1) != 0) { - memcpy1 (dest, src, size); - return; - } - if ((((int)dest | (int)src) & 2) != 0) { - memcpy2 (dest, src, size); - return; - } - } - memcpy4 (dest, src, size); - } - } -} diff --git a/mcs/class/corlib/System/Comparison.cs b/mcs/class/corlib/System/Comparison.cs deleted file mode 100644 index f15ba11b37c..00000000000 --- a/mcs/class/corlib/System/Comparison.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// Comparison.cs -// -// Authors: -// Ben Maurer (bmaurer@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// Copyright (C) 2004 Novell -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System -{ - public delegate int Comparison (T x, T y); -} - diff --git a/mcs/class/corlib/System/ConsoleCancelEventArgs.cs b/mcs/class/corlib/System/ConsoleCancelEventArgs.cs deleted file mode 100644 index 8684879fd16..00000000000 --- a/mcs/class/corlib/System/ConsoleCancelEventArgs.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// System.ConsoleCancelEventArgs -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - [Serializable] - public sealed class ConsoleCancelEventArgs : EventArgs { - bool cancel; - ConsoleSpecialKey specialKey; - - internal ConsoleCancelEventArgs (ConsoleSpecialKey key) - { - specialKey = key; - } - - public bool Cancel { - get { return cancel; } - set { cancel = value; } - } - - public ConsoleSpecialKey SpecialKey { - get { return specialKey; } - } - } -} - diff --git a/mcs/class/corlib/System/ConsoleCancelEventHandler.cs b/mcs/class/corlib/System/ConsoleCancelEventHandler.cs deleted file mode 100644 index 027072f7054..00000000000 --- a/mcs/class/corlib/System/ConsoleCancelEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.ConsoleCancelEventHandler -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System { - public delegate void ConsoleCancelEventHandler (object sender, ConsoleCancelEventArgs e); -} - diff --git a/mcs/class/corlib/System/ConsoleColor.cs b/mcs/class/corlib/System/ConsoleColor.cs deleted file mode 100644 index e148296f694..00000000000 --- a/mcs/class/corlib/System/ConsoleColor.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// System.ConsoleColor -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System { - [Serializable] - public enum ConsoleColor { - Black, - DarkBlue, - DarkGreen, - DarkCyan, - DarkRed, - DarkMagenta, - DarkYellow, - Gray, - DarkGray, - Blue, - Green, - Cyan, - Red, - Magenta, - Yellow, - White - } -} - diff --git a/mcs/class/corlib/System/ConsoleKey.cs b/mcs/class/corlib/System/ConsoleKey.cs deleted file mode 100644 index 78660b594a0..00000000000 --- a/mcs/class/corlib/System/ConsoleKey.cs +++ /dev/null @@ -1,180 +0,0 @@ -// -// System.ConsoleKey -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System { - - [Serializable] - public enum ConsoleKey { - Backspace = 8, - Tab = 9, - Clear = 12, - Enter = 13, - Pause = 19, - Escape = 27, - Spacebar = 32, - PageUp = 33, - PageDown = 34, - End = 35, - Home = 36, - LeftArrow = 37, - UpArrow = 38, - RightArrow = 39, - DownArrow = 40, - Select = 41, - Print = 42, - Execute = 43, - PrintScreen = 44, - Insert = 45, - Delete = 46, - Help = 47, - D0 = 48, - D1 = 49, - D2 = 50, - D3 = 51, - D4 = 52, - D5 = 53, - D6 = 54, - D7 = 55, - D8 = 56, - D9 = 57, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - LeftWindows = 91, - RightWindows = 92, - Applications = 93, - Sleep = 95, - NumPad0 = 96, - NumPad1 = 97, - NumPad2 = 98, - NumPad3 = 99, - NumPad4 = 100, - NumPad5 = 101, - NumPad6 = 102, - NumPad7 = 103, - NumPad8 = 104, - NumPad9 = 105, - Multiply = 106, - Add = 107, - Separator = 108, - Subtract = 109, - Decimal = 110, - Divide = 111, - F1 = 112, - F2 = 113, - F3 = 114, - F4 = 115, - F5 = 116, - F6 = 117, - F7 = 118, - F8 = 119, - F9 = 120, - F10 = 121, - F11 = 122, - F12 = 123, - F13 = 124, - F14 = 125, - F15 = 126, - F16 = 127, - F17 = 128, - F18 = 129, - F19 = 130, - F20 = 131, - F21 = 132, - F22 = 133, - F23 = 134, - F24 = 135, - BrowserBack = 166, - BrowserForward = 167, - BrowserRefresh = 168, - BrowserStop = 169, - BrowserSearch = 170, - BrowserFavorites = 171, - BrowserHome = 172, - VolumeMute = 173, - VolumeDown = 174, - VolumeUp = 175, - MediaNext = 176, - MediaPrevious = 177, - MediaStop = 178, - MediaPlay = 179, - LaunchMail = 180, - LaunchMediaSelect = 181, - LaunchApp1 = 182, - LaunchApp2 = 183, - Oem1 = 186, - OemPlus = 187, - OemComma = 188, - OemMinus = 189, - OemPeriod = 190, - Oem2 = 191, - Oem3 = 192, - Oem4 = 219, - Oem5 = 220, - Oem6 = 221, - Oem7 = 222, - Oem8 = 223, - Oem102 = 226, - Process = 229, - Packet = 231, - Attention = 246, - CrSel = 247, - ExSel = 248, - EraseEndOfFile = 249, - Play = 250, - Zoom = 251, - NoName = 252, - Pa1 = 253, - OemClear = 254, - } -} - diff --git a/mcs/class/corlib/System/ConsoleKeyInfo.cs b/mcs/class/corlib/System/ConsoleKeyInfo.cs deleted file mode 100644 index 961cb949d62..00000000000 --- a/mcs/class/corlib/System/ConsoleKeyInfo.cs +++ /dev/null @@ -1,113 +0,0 @@ -// -// System.ConsoleKeyInfo.cs -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System { - [Serializable] - public struct ConsoleKeyInfo { - internal static ConsoleKeyInfo Empty = new ConsoleKeyInfo ('\0', 0, false, false, false); - ConsoleKey _key; - char _keyChar; - ConsoleModifiers _mods; - - public ConsoleKeyInfo (char keyChar, ConsoleKey key, bool shift, bool alt, bool control) - { - _key = key; - _keyChar = keyChar; - _mods = 0; - SetModifiers (shift, alt, control); - } - - internal ConsoleKeyInfo (ConsoleKeyInfo other) - { - _key = other._key; - _keyChar = other._keyChar; - _mods = other._mods; - } - - internal void SetKey (ConsoleKey key) - { - _key = key; - } - - internal void SetKeyChar (char keyChar) - { - _keyChar = keyChar; - } - - internal void SetModifiers (bool shift, bool alt, bool control) - { - _mods = (shift) ? ConsoleModifiers.Shift : 0; - _mods |= (alt) ? ConsoleModifiers.Alt : 0; - _mods |= (control) ? ConsoleModifiers.Control : 0; - } - - public ConsoleKey Key - { - get { return _key; } - } - - public char KeyChar - { - get { return _keyChar; } - } - - public ConsoleModifiers Modifiers - { - get { return _mods; } - } - - public override bool Equals (object value) - { - if (!(value is ConsoleKeyInfo)) - return false; - - return Equals ((ConsoleKeyInfo) value); - } - - public static bool operator == (ConsoleKeyInfo a, ConsoleKeyInfo b) - { - return a.Equals (b); - } - - public static bool operator != (ConsoleKeyInfo a, ConsoleKeyInfo b) - { - return !a.Equals (b); - } - - public bool Equals (ConsoleKeyInfo obj) - { - return _key == obj._key && _keyChar == obj._keyChar && _mods == obj._mods; - } - - public override int GetHashCode () - { - return _key.GetHashCode () ^ _keyChar.GetHashCode () ^ _mods.GetHashCode (); - } - } -} diff --git a/mcs/class/corlib/System/ConsoleModifiers.cs b/mcs/class/corlib/System/ConsoleModifiers.cs deleted file mode 100644 index da716264af6..00000000000 --- a/mcs/class/corlib/System/ConsoleModifiers.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.ConsoleModifiers -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System { - [Flags] - [Serializable] - public enum ConsoleModifiers { - Alt = 1, - Shift = 2, - Control = 4 - } -} - diff --git a/mcs/class/corlib/System/ConsoleSpecialKey.cs b/mcs/class/corlib/System/ConsoleSpecialKey.cs deleted file mode 100644 index 2d08ba4b854..00000000000 --- a/mcs/class/corlib/System/ConsoleSpecialKey.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.ConsoleSpecialKey -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System { - [Serializable] - public enum ConsoleSpecialKey { - ControlC, - ControlBreak - } -} - - diff --git a/mcs/class/corlib/System/ContextBoundObject.cs b/mcs/class/corlib/System/ContextBoundObject.cs deleted file mode 100644 index ca954d6d758..00000000000 --- a/mcs/class/corlib/System/ContextBoundObject.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.ContextBoundObject.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System -{ - [Serializable] - [ComVisible (true)] - public abstract class ContextBoundObject : MarshalByRefObject - { - protected ContextBoundObject () - { - } - } -} diff --git a/mcs/class/corlib/System/Converter.cs b/mcs/class/corlib/System/Converter.cs deleted file mode 100644 index 07e56188ea3..00000000000 --- a/mcs/class/corlib/System/Converter.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// Converter.cs -// -// Authors: -// Ben Maurer (bmaurer@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// Copyright (C) 2004 Novell -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System -{ - public delegate TOutput Converter (TInput input); -} diff --git a/mcs/class/corlib/System/Environment.cs b/mcs/class/corlib/System/Environment.cs index ddbd37a5e27..fceac801220 100644 --- a/mcs/class/corlib/System/Environment.cs +++ b/mcs/class/corlib/System/Environment.cs @@ -57,7 +57,7 @@ namespace System { * of icalls, do not require an increment. */ #pragma warning disable 169 - private const int mono_corlib_version = 125; + private const int mono_corlib_version = 127; #pragma warning restore 169 [ComVisible (true)] diff --git a/mcs/class/corlib/System/EventArgs.cs b/mcs/class/corlib/System/EventArgs.cs deleted file mode 100644 index 6d903ec2cab..00000000000 --- a/mcs/class/corlib/System/EventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// System.EventArgs.cs -// -// Author: -// Michael Lambert (michaellambert@email.com) -// -// (C) 2001 Michael Lambert, All Rights Reserved -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System -{ - [Serializable] - [ComVisible (true)] - public class EventArgs - { - public static readonly EventArgs Empty = new EventArgs (); - - public EventArgs () - { - } - } -} diff --git a/mcs/class/corlib/System/EventHandler.cs b/mcs/class/corlib/System/EventHandler.cs deleted file mode 100644 index 4d6706799dd..00000000000 --- a/mcs/class/corlib/System/EventHandler.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.EventHandler.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - - [Serializable] - public delegate void EventHandler (object sender, TEventArgs e) - ; - - [Serializable] - [System.Runtime.InteropServices.ComVisible (true)] - public delegate void EventHandler (object sender, EventArgs e); -} diff --git a/mcs/class/corlib/System/Funcs.cs b/mcs/class/corlib/System/Funcs.cs deleted file mode 100644 index df011e8cea8..00000000000 --- a/mcs/class/corlib/System/Funcs.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// System.Func.cs -// -// Authors: -// Alejandro Serrano "Serras" (trupill@yahoo.es) -// Marek Safar (marek.safar@gmail.com) -// - -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR TArg PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// - -using System.Runtime.CompilerServices; - -namespace System { - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate TResult Func (); - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate TResult Func (T arg); - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate TResult Func (T1 arg1, T2 arg2); - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate TResult Func (T1 arg1, T2 arg2, T3 arg3); - -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public delegate TResult Func (T1 arg1, T2 arg2, T3 arg3, T4 arg4); - - public delegate TResult Func (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5); - public delegate TResult Func (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6); - public delegate TResult Func (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7); - public delegate TResult Func (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8); -} diff --git a/mcs/class/corlib/System/IAppDomainSetup.cs b/mcs/class/corlib/System/IAppDomainSetup.cs deleted file mode 100644 index c4e6a7a4fdc..00000000000 --- a/mcs/class/corlib/System/IAppDomainSetup.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// System.IAppDomainSetup.cs -// -// Author: -// Dietmar Maurer (dietmar@ximian.com) -// -// (C) 2001 Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Runtime.InteropServices; - -namespace System { - - [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)] - [Guid ("27FFF232-A7A8-40DD-8D4A-734AD59FCD41")] - [ComVisible(true)] - public interface IAppDomainSetup { - - string ApplicationBase { get; set; } - - string ApplicationName { get; set; } - - string CachePath { get; set; } - - string ConfigurationFile { get; set; } - - string DynamicBase { get; set; } - - string LicenseFile { get; set; } - - string PrivateBinPath { get; set; } - - string PrivateBinPathProbe { get; set; } - - string ShadowCopyDirectories { get; set; } - - string ShadowCopyFiles { get; set; } - } -} diff --git a/mcs/class/corlib/System/IApplicationDescription.cs b/mcs/class/corlib/System/IApplicationDescription.cs deleted file mode 100644 index 95f2967700a..00000000000 --- a/mcs/class/corlib/System/IApplicationDescription.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// System.IApplicationDescription interface -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - - public interface IApplicationDescription : ICloneable { - - string ApplicationCodeBase { - get; - } - - string ApplicationManifest { - get; - } - - string ApplicationManifestPath { - get; - } - - string DeploymentCodeBase { - get; - } - - string DeploymentManifest { - get; - } - - string DeploymentManifestPath { - get; - } - } -} diff --git a/mcs/class/corlib/System/IAsyncResult.cs b/mcs/class/corlib/System/IAsyncResult.cs deleted file mode 100644 index 94062b85493..00000000000 --- a/mcs/class/corlib/System/IAsyncResult.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// -// System.IAsyncResult.cs -// -// Copyright (C) 2001 Michael Lambert, All Rights Reserved -// -// Author: Michael Lambert, michaellambert@email.com -// Created: Mon 08/24/2001 -// -//------------------------------------------------------------------------------ -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Threading; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace System { - - [ComVisible(true)] - public interface IAsyncResult - { - object AsyncState - { - get; - } - - WaitHandle AsyncWaitHandle - { - get; - } - - bool CompletedSynchronously - { - get; - } - - bool IsCompleted - { - get; - } - } - -} // Namespace System - - diff --git a/mcs/class/corlib/System/ICloneable.cs b/mcs/class/corlib/System/ICloneable.cs deleted file mode 100644 index 931f53422a2..00000000000 --- a/mcs/class/corlib/System/ICloneable.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.ICloneable.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System { - [ComVisible(true)] -#if INSIDE_CORLIB - public -#else - internal -#endif - interface ICloneable { - object Clone (); - } -} diff --git a/mcs/class/corlib/System/IComparable.cs b/mcs/class/corlib/System/IComparable.cs deleted file mode 100644 index c5330021b0e..00000000000 --- a/mcs/class/corlib/System/IComparable.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// System.IComparable.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System { - - [ComVisible(true)] - public interface IComparable { - int CompareTo (object obj); - } - - public interface IComparable { - int CompareTo (T other); - } -} diff --git a/mcs/class/corlib/System/IConvertible.cs b/mcs/class/corlib/System/IConvertible.cs deleted file mode 100644 index 3816252230c..00000000000 --- a/mcs/class/corlib/System/IConvertible.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -// System.IConvertible.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -// -// Functions Implementing this interface should check out -// System.Convert. Most of these methods are implemented -// there for all these data types. -// -// System.Convert has ToType helper method for the object -// ToType (Type conversionType, IFormatProvider provider) -// method. In most cases you can specify your ToType function -// as calling -// -// public Type value; // value of this data type -// public object ToType(Type conversionType, IFormatProvider provider) { -// Convert.ToType (value, conversionType, provider); -// } -// -// Which is just a wrapper for your ToType methods. -// -// See http://lists.ximian.com/archives/public/mono-list/2001-July/000525.html -// for more discussion on the topic -// -using System.Runtime.InteropServices; - -namespace System { - - [ComVisible(true)] - [CLSCompliant(false)] - public interface IConvertible { - - TypeCode GetTypeCode (); - - bool ToBoolean (IFormatProvider provider); - byte ToByte (IFormatProvider provider); - char ToChar (IFormatProvider provider); - DateTime ToDateTime (IFormatProvider provider); - decimal ToDecimal (IFormatProvider provider); - double ToDouble (IFormatProvider provider); - short ToInt16 (IFormatProvider provider); - int ToInt32 (IFormatProvider provider); - long ToInt64 (IFormatProvider provider); - sbyte ToSByte (IFormatProvider provider); - float ToSingle (IFormatProvider provider); - string ToString (IFormatProvider provider); - object ToType (Type conversionType, IFormatProvider provider); - ushort ToUInt16 (IFormatProvider provider); - uint ToUInt32 (IFormatProvider provider); - ulong ToUInt64 (IFormatProvider provider); - } -} diff --git a/mcs/class/corlib/System/ICustomFormatter.cs b/mcs/class/corlib/System/ICustomFormatter.cs deleted file mode 100644 index 876c5ce3c45..00000000000 --- a/mcs/class/corlib/System/ICustomFormatter.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.ICustomFormatter.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System { - - [ComVisible(true)] - public interface ICustomFormatter { - string Format (string format, object arg, IFormatProvider formatProvider); - } -} diff --git a/mcs/class/corlib/System/IDisposable.cs b/mcs/class/corlib/System/IDisposable.cs deleted file mode 100644 index 9c1859af508..00000000000 --- a/mcs/class/corlib/System/IDisposable.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.IDisposable.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System { - - [ComVisible(true)] - public interface IDisposable { - - void Dispose (); - - } -} diff --git a/mcs/class/corlib/System/IEquatable.cs b/mcs/class/corlib/System/IEquatable.cs deleted file mode 100644 index c4092d9b243..00000000000 --- a/mcs/class/corlib/System/IEquatable.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.IEquatable.cs -// -// Author: -// Ben Maurer -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - public interface IEquatable { - bool Equals (T other); - } -} diff --git a/mcs/class/corlib/System/IFormatProvider.cs b/mcs/class/corlib/System/IFormatProvider.cs deleted file mode 100644 index 26afc9e16a7..00000000000 --- a/mcs/class/corlib/System/IFormatProvider.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.IFormatProvider.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System { - - [ComVisible(true)] - public interface IFormatProvider { - object GetFormat (Type formatType); - } -} diff --git a/mcs/class/corlib/System/IFormattable.cs b/mcs/class/corlib/System/IFormattable.cs deleted file mode 100644 index 30a8670972a..00000000000 --- a/mcs/class/corlib/System/IFormattable.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.IFormattable.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Runtime.InteropServices; - -namespace System { - - [ComVisible(true)] - public interface IFormattable { - string ToString (string format, IFormatProvider formatProvider); - } -} diff --git a/mcs/class/corlib/System/IHostContext.cs b/mcs/class/corlib/System/IHostContext.cs deleted file mode 100644 index 841fa084999..00000000000 --- a/mcs/class/corlib/System/IHostContext.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// System.IHostContext interface -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - - public interface IHostContext { - - bool AssumeTrust { - get; - } - - bool ExclusiveGrant { - get; - } - - bool IsFirstTimeInstall { - get; - } - - bool NoPrompt { - get; - } - - bool Persist { - get; - } - } -} diff --git a/mcs/class/corlib/System/IObservable.cs b/mcs/class/corlib/System/IObservable.cs deleted file mode 100644 index 5274dbb30cd..00000000000 --- a/mcs/class/corlib/System/IObservable.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// IObservable.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System -{ - public interface IObservable - { - IDisposable Subscribe (IObserver observer); - } -} - diff --git a/mcs/class/corlib/System/IObserver.cs b/mcs/class/corlib/System/IObserver.cs deleted file mode 100644 index f6aaf6bb320..00000000000 --- a/mcs/class/corlib/System/IObserver.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// IObserver.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System -{ - public interface IObserver - { - void OnCompleted (); - void OnError (Exception error); - void OnNext(T value); - } -} - diff --git a/mcs/class/corlib/System/IProgress.cs b/mcs/class/corlib/System/IProgress.cs deleted file mode 100644 index 690f62d5b3e..00000000000 --- a/mcs/class/corlib/System/IProgress.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// IProgress.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2011 Xamarin, Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System -{ - public interface IProgress - { - void Report (T value); - } -} - diff --git a/mcs/class/corlib/System/IServiceProvider.cs b/mcs/class/corlib/System/IServiceProvider.cs deleted file mode 100644 index d9d0faa809d..00000000000 --- a/mcs/class/corlib/System/IServiceProvider.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.IServiceProvider.cs -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Runtime.InteropServices; - -namespace System -{ - public interface IServiceProvider - { - object GetService (Type serviceType); - } -} diff --git a/mcs/class/corlib/System/InvalidTimeZoneException.cs b/mcs/class/corlib/System/InvalidTimeZoneException.cs deleted file mode 100644 index 27dd66a92a5..00000000000 --- a/mcs/class/corlib/System/InvalidTimeZoneException.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * System.InvalidimeZoneException - * - * Author(s) - * Stephane Delcroix - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -using System.Runtime.CompilerServices; - -namespace System -{ - [Serializable] -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public - class InvalidTimeZoneException : Exception - { - public InvalidTimeZoneException () : base () - {} - - public InvalidTimeZoneException (string message) : base (message) - {} - - public InvalidTimeZoneException (string message, Exception innerException) : base (message, innerException) - {} - - protected InvalidTimeZoneException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context) - {} - } -} diff --git a/mcs/class/corlib/System/NullConsoleDriver.cs b/mcs/class/corlib/System/NullConsoleDriver.cs index 4ffabc85a30..ecec3b508b2 100644 --- a/mcs/class/corlib/System/NullConsoleDriver.cs +++ b/mcs/class/corlib/System/NullConsoleDriver.cs @@ -30,7 +30,10 @@ using System.Runtime.InteropServices; using System.Text; namespace System { - class NullConsoleDriver : IConsoleDriver { + class NullConsoleDriver : IConsoleDriver + { + static readonly ConsoleKeyInfo EmptyConsoleKeyInfo = new ConsoleKeyInfo ('\0', 0, false, false, false); + public ConsoleColor BackgroundColor { get { return ConsoleColor.Black; } set { @@ -151,7 +154,7 @@ namespace System { public ConsoleKeyInfo ReadKey (bool intercept) { - return ConsoleKeyInfo.Empty; + return EmptyConsoleKeyInfo; } public void ResetColor () diff --git a/mcs/class/corlib/System/Predicate.cs b/mcs/class/corlib/System/Predicate.cs deleted file mode 100644 index 66086b0a9bb..00000000000 --- a/mcs/class/corlib/System/Predicate.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Predicate.cs -// -// Authors: -// Ben Maurer (bmaurer@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// Copyright (C) 2004 Novell -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System -{ - public delegate bool Predicate (T obj); -} - diff --git a/mcs/class/corlib/System/TermInfoReader.cs b/mcs/class/corlib/System/TermInfoReader.cs index f4b03396225..6424d4fb79a 100644 --- a/mcs/class/corlib/System/TermInfoReader.cs +++ b/mcs/class/corlib/System/TermInfoReader.cs @@ -229,7 +229,7 @@ namespace System { length++; byte [] result = new byte [length]; - Buffer.BlockCopyInternal (buffer, offset, result, 0, length); + Buffer.InternalBlockCopy (buffer, offset, result, 0, length); return result; } diff --git a/mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs b/mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs deleted file mode 100644 index 3afac7722d7..00000000000 --- a/mcs/class/corlib/System/TimeZoneInfo.AdjustmentRule.cs +++ /dev/null @@ -1,185 +0,0 @@ -/* - * System.TimeZoneInfo.AdjustmentRule - * - * Author(s) - * Stephane Delcroix - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - -namespace System -{ - public - sealed partial class TimeZoneInfo { - [SerializableAttribute] -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public sealed class AdjustmentRule : IEquatable, ISerializable, IDeserializationCallback - { - DateTime dateEnd; - public DateTime DateEnd { - get { return dateEnd; } - } - - DateTime dateStart; - public DateTime DateStart { - get { return dateStart; } - } - - TimeSpan daylightDelta; - public TimeSpan DaylightDelta { - get { return daylightDelta; } - } - - TransitionTime daylightTransitionEnd; - public TransitionTime DaylightTransitionEnd { - get { return daylightTransitionEnd; } - } - - TransitionTime daylightTransitionStart; - public TransitionTime DaylightTransitionStart { - get { return daylightTransitionStart; } - } - - public static AdjustmentRule CreateAdjustmentRule ( - DateTime dateStart, - DateTime dateEnd, - TimeSpan daylightDelta, - TransitionTime daylightTransitionStart, - TransitionTime daylightTransitionEnd) - { - return new AdjustmentRule (dateStart, dateEnd, daylightDelta, daylightTransitionStart, daylightTransitionEnd); - } - - private AdjustmentRule (SerializationInfo info, StreamingContext context) - { - if (info == null) - throw new ArgumentNullException ("info"); - dateStart = (DateTime) info.GetValue ("DateStart", typeof (DateTime)); - dateEnd = (DateTime) info.GetValue ("DateEnd", typeof (DateTime)); - daylightDelta = (TimeSpan) info.GetValue ("DaylightDelta", typeof (TimeSpan)); - daylightTransitionStart = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionStart", typeof (TimeZoneInfo.TransitionTime)); - daylightTransitionEnd = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionEnd", typeof (TimeZoneInfo.TransitionTime)); - } - - private AdjustmentRule ( - DateTime dateStart, - DateTime dateEnd, - TimeSpan daylightDelta, - TransitionTime daylightTransitionStart, - TransitionTime daylightTransitionEnd) - { - if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified) - throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified"); - - if (daylightTransitionStart == daylightTransitionEnd) - throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter"); - - if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0) - throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value"); - - if (dateEnd < dateStart) - throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart"); - - if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0)) - throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours"); - - if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0) - throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds"); - - this.dateStart = dateStart; - this.dateEnd = dateEnd; - this.daylightDelta = daylightDelta; - this.daylightTransitionStart = daylightTransitionStart; - this.daylightTransitionEnd = daylightTransitionEnd; - } - - public bool Equals (TimeZoneInfo.AdjustmentRule other) - { - return dateStart == other.dateStart && - dateEnd == other.dateEnd && - daylightDelta == other.daylightDelta && - daylightTransitionStart == other.daylightTransitionStart && - daylightTransitionEnd == other.daylightTransitionEnd; - } - - public override int GetHashCode () - { - return dateStart.GetHashCode () ^ - dateEnd.GetHashCode () ^ - daylightDelta.GetHashCode () ^ - daylightTransitionStart.GetHashCode () ^ - daylightTransitionEnd.GetHashCode (); - } - - void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) - { - if (info == null) - throw new ArgumentNullException ("info"); - info.AddValue ("DateStart", DateStart); - info.AddValue ("DateEnd", DateEnd); - info.AddValue ("DaylightDelta", DaylightDelta); - info.AddValue ("DaylightTransitionStart", DaylightTransitionStart); - info.AddValue ("DaylightTransitionEnd", DaylightTransitionEnd); - } - void IDeserializationCallback.OnDeserialization (object sender) - { - try { - TimeZoneInfo.AdjustmentRule.Validate (dateStart, dateEnd, daylightDelta, - daylightTransitionStart, daylightTransitionEnd); - } catch (ArgumentException ex) { - throw new SerializationException ("invalid serialization data", ex); - } - } - - private static void Validate ( - DateTime dateStart, - DateTime dateEnd, - TimeSpan daylightDelta, - TransitionTime daylightTransitionStart, - TransitionTime daylightTransitionEnd) - { - if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified) - throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified"); - - if (daylightTransitionStart == daylightTransitionEnd) - throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter"); - - if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0) - throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value"); - - if (dateEnd < dateStart) - throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart"); - - if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0)) - throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours"); - - if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0) - throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds"); - } - } - } -} diff --git a/mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs b/mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs deleted file mode 100644 index 37a70641be4..00000000000 --- a/mcs/class/corlib/System/TimeZoneInfo.TransitionTime.cs +++ /dev/null @@ -1,290 +0,0 @@ -/* - * System.TimeZoneInfo.TransitionTime - * - * Author(s) - * Stephane Delcroix - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - -namespace System -{ - public - sealed partial class TimeZoneInfo - { - [SerializableAttribute] -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public struct TransitionTime : IEquatable, ISerializable, IDeserializationCallback - { - DateTime timeOfDay; - public DateTime TimeOfDay { - get { return timeOfDay; } - } - - int month; - public int Month { - get { return month; } - } - - int day; - public int Day { - get { -#if STRICT - if (!isFixedDateRule) - throw new Exception ("Day property is not valid for floating date rules"); -#endif - return day; - } - } - - int week; - public int Week { - get { -#if STRICT - if (isFixedDateRule) - throw new Exception ("Week property is not valid for fixed date rules"); -#endif - - return week; - } - } - - DayOfWeek dayOfWeek; - public DayOfWeek DayOfWeek { - get { -#if STRICT - if (isFixedDateRule) - throw new Exception ("DayOfWeek property is not valid for fixed date rules"); -#endif - - return dayOfWeek; - } - } - - bool isFixedDateRule; - public bool IsFixedDateRule { - get { return isFixedDateRule; } - } - - public static TransitionTime CreateFixedDateRule ( - DateTime timeOfDay, - int month, - int day) - { - return new TransitionTime (timeOfDay, month, day); - } - - public static TransitionTime CreateFloatingDateRule ( - DateTime timeOfDay, - int month, - int week, - DayOfWeek dayOfWeek) - { - return new TransitionTime (timeOfDay, month, week, dayOfWeek); - } - - private TransitionTime (SerializationInfo info, StreamingContext context) - { - if (info == null) - throw new ArgumentNullException ("info"); - timeOfDay = (DateTime) info.GetValue ("TimeOfDay", typeof (DateTime)); - month = (byte) info.GetValue ("Month", typeof (byte)); - week = (byte) info.GetValue ("Week", typeof (byte)); - day = (byte) info.GetValue ("Day", typeof (byte)); - dayOfWeek = (DayOfWeek) info.GetValue ("DayOfWeek", typeof (DayOfWeek)); - isFixedDateRule = (bool) info.GetValue ("IsFixedDateRule", typeof (bool)); - - if (isFixedDateRule) - { - week = -1; - dayOfWeek = (DayOfWeek) (-1); - } - if (!isFixedDateRule) - day = -1; - } - - private TransitionTime ( - DateTime timeOfDay, - int month, - int day) : this (timeOfDay, month) - { - if (day < 1 || day > 31) - throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31"); - - this.day = day; - this.isFixedDateRule = true; - } - - private TransitionTime ( - DateTime timeOfDay, - int month, - int week, - DayOfWeek dayOfWeek) : this (timeOfDay, month) - { - if (week < 1 || week > 5) - throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5"); - - if (dayOfWeek != DayOfWeek.Sunday && - dayOfWeek != DayOfWeek.Monday && - dayOfWeek != DayOfWeek.Tuesday && - dayOfWeek != DayOfWeek.Wednesday && - dayOfWeek != DayOfWeek.Thursday && - dayOfWeek != DayOfWeek.Friday && - dayOfWeek != DayOfWeek.Saturday) - throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration"); - - this.week = week; - this.dayOfWeek = dayOfWeek; - this.isFixedDateRule = false; - } - - private TransitionTime ( - DateTime timeOfDay, - int month) - { - if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1) - throw new ArgumentException ("timeOfDay parameter has a non-default date component"); - - if (timeOfDay.Kind != DateTimeKind.Unspecified) - throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified"); - - if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0) - throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds"); - - if (month < 1 || month > 12) - throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12"); - - this.timeOfDay = timeOfDay; - this.month = month; - - this.week = -1; - this.dayOfWeek = (System.DayOfWeek)(-1); - this.day = -1; - this.isFixedDateRule = false; - } - - public static bool operator == (TransitionTime t1, TransitionTime t2) - { - return ( t1.day == t2.day && - t1.dayOfWeek == t2.dayOfWeek && - t1.isFixedDateRule == t2.isFixedDateRule && - t1.month == t2.month && - t1.timeOfDay == t2.timeOfDay && - t1.week == t2.week); - } - - public static bool operator != (TransitionTime t1, TransitionTime t2) - { - return !(t1 == t2); - } - - - void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) - { - if (info == null) - throw new ArgumentNullException ("info"); - info.AddValue ("TimeOfDay", TimeOfDay); - info.AddValue ("Month", System.Convert.ToByte(Month)); - if (week > -1) - info.AddValue ("Week", System.Convert.ToByte(week)); - else - info.AddValue ("Week", (byte) 1); - if (day > -1) - info.AddValue ("Day", System.Convert.ToByte(day)); - else - info.AddValue ("Day", (byte) 1); - if (dayOfWeek != ((System.DayOfWeek) (-1))) - info.AddValue ("DayOfWeek", dayOfWeek); - else - info.AddValue ("DayOfWeek", DayOfWeek.Sunday); - info.AddValue ("IsFixedDateRule", IsFixedDateRule); - } - - public override bool Equals (object obj) - { - if (obj is TransitionTime) - return this == (TransitionTime) obj; - return false; - } - - public bool Equals (TimeZoneInfo.TransitionTime other) - { - return this == other; - } - - public override int GetHashCode () - { - return (day ^ (int)dayOfWeek ^ month ^ (int)timeOfDay.Ticks ^ week); - } - - void IDeserializationCallback.OnDeserialization (object sender) - { - try { - TimeZoneInfo.TransitionTime.Validate (timeOfDay, month, week, day, dayOfWeek, isFixedDateRule); - } catch (ArgumentException ex) { - throw new SerializationException ("invalid serialization data", ex); - } - } - - private static void Validate (DateTime timeOfDay, int month,int week, int day, DayOfWeek dayOfWeek, bool isFixedDateRule) - { - if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1) - throw new ArgumentException ("timeOfDay parameter has a non-default date component"); - - if (timeOfDay.Kind != DateTimeKind.Unspecified) - throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified"); - - if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0) - throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds"); - - if (day < 1 || day > 31) { - if (!(!isFixedDateRule && day == -1)) - throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31"); - } - - if (week < 1 || week > 5) { - if (!(isFixedDateRule && week == -1)) - throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5"); - } - - if (month < 1 || month > 12) - throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12"); - - if (dayOfWeek != DayOfWeek.Sunday && - dayOfWeek != DayOfWeek.Monday && - dayOfWeek != DayOfWeek.Tuesday && - dayOfWeek != DayOfWeek.Wednesday && - dayOfWeek != DayOfWeek.Thursday && - dayOfWeek != DayOfWeek.Friday && - dayOfWeek != DayOfWeek.Saturday) { - if (!(isFixedDateRule && dayOfWeek == (DayOfWeek) (-1))) - throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration"); - } - } - } - } -} diff --git a/mcs/class/corlib/System/TimeZoneInfo.cs b/mcs/class/corlib/System/TimeZoneInfo.cs index 3c0b535b43b..aa93584c933 100644 --- a/mcs/class/corlib/System/TimeZoneInfo.cs +++ b/mcs/class/corlib/System/TimeZoneInfo.cs @@ -45,14 +45,7 @@ using Microsoft.Win32; namespace System { -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - [SerializableAttribute] - public - sealed partial class TimeZoneInfo : IEquatable, ISerializable, IDeserializationCallback + partial class TimeZoneInfo { TimeSpan baseUtcOffset; public TimeSpan BaseUtcOffset { diff --git a/mcs/class/corlib/System/TimeZoneNotFoundException.cs b/mcs/class/corlib/System/TimeZoneNotFoundException.cs deleted file mode 100644 index 1333d971c82..00000000000 --- a/mcs/class/corlib/System/TimeZoneNotFoundException.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * System.TimeZoneNotFoundException - * - * Author(s) - * Stephane Delcroix - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -using System.Runtime.CompilerServices; - -namespace System -{ - [Serializable] -#if MOBILE - [TypeForwardedFrom (Consts.AssemblySystem_Core)] -#else - [TypeForwardedFrom (Consts.AssemblySystemCore_3_5)] -#endif - public - class TimeZoneNotFoundException : Exception - { - public TimeZoneNotFoundException () : base () - {} - - public TimeZoneNotFoundException (string message) : base (message) - {} - - public TimeZoneNotFoundException (string message, Exception innerException) : base (message, innerException) - {} - - protected TimeZoneNotFoundException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context) - {} - } -} diff --git a/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs b/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs index a361fbc50f8..129ee6d0bcc 100644 --- a/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs @@ -633,6 +633,60 @@ namespace MonoTests.System.Collections.Generic { } } +#if !MONO + [Test] + public void SerializationCompatibilty () + { + /* Serialization output from .net + + var dict = new Dictionary (); + dict.Add ("key", "value"); + + var dictSerializedStream = new MemoryStream (); + fmt.Serialize (dictSerializedStream, dict); + + dictSerializedStream.Seek (0, SeekOrigin.Begin); + var res = Convert.ToBase64String (dictSerializedStream.ToArray (), Base64FormattingOptions.InsertLineBreaks); + + */ + + var x = "AAEAAAD/////AQAAAAAAAAAEAQAAAOIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuRGljdGlv" + + "bmFyeWAyW1tTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJl" + + "PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldLFtTeXN0ZW0uU3RyaW5n" + + "LCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRv" + + "a2VuPWI3N2E1YzU2MTkzNGUwODldXQQAAAAHVmVyc2lvbghDb21wYXJlcghIYXNoU2l6ZQ1LZXlW" + + "YWx1ZVBhaXJzAAMAAwiSAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkdlbmVyaWNFcXVhbGl0" + + "eUNvbXBhcmVyYDFbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1" + + "bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCOYBU3lzdGVt" + + "LkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFsdWVQYWlyYDJbW1N5c3RlbS5TdHJpbmcsIG1zY29y" + + "bGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3" + + "YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAs" + + "IEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dW10BAAAA" + + "CQIAAAADAAAACQMAAAAEAgAAAJIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuR2VuZXJpY0Vx" + + "dWFsaXR5Q29tcGFyZXJgMVtbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAu" + + "MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0AAAAA" + + "BwMAAAAAAQAAAAEAAAAD5AFTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5LZXlWYWx1ZVBhaXJg" + + "MltbU3lzdGVtLlN0cmluZywgbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0" + + "cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XSxbU3lzdGVtLlN0cmluZywgbXNj" + + "b3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1i" + + "NzdhNWM1NjE5MzRlMDg5XV0E/P///+QBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuS2V5VmFs" + + "dWVQYWlyYDJbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1" + + "cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJp" + + "bmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5" + + "VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dAgAAAANrZXkFdmFsdWUBAQYFAAAAA2tleQYGAAAABXZh" + + "bHVlCw=="; + + var dict = new Dictionary (); + dict.Add ("key", "value"); + + BinaryFormatter fmt = new BinaryFormatter (); + var mdict = (Dictionary) fmt.Deserialize (new MemoryStream (Convert.FromBase64String (x))); + + Assert.AreEqual (1, dict.Count); + Assert.AreEqual (dict.Comparer.GetType (), mdict.Comparer.GetType ()); + } +#endif + [Test] public void ZeroCapacity () { diff --git a/mcs/class/corlib/Test/System.Collections.Generic/EqualityComparerTest.cs b/mcs/class/corlib/Test/System.Collections.Generic/EqualityComparerTest.cs index 5a0fd3b6a25..e238781bcb7 100644 --- a/mcs/class/corlib/Test/System.Collections.Generic/EqualityComparerTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/EqualityComparerTest.cs @@ -37,6 +37,11 @@ namespace MonoTests.System.Collections.Generic { [TestFixture] public class EqualityComparerTest { + enum E + { + A, + B + } [Test] public void Default_GetHashCode_Null () @@ -59,6 +64,13 @@ namespace MonoTests.System.Collections.Generic { IEqualityComparer comparer = EqualityComparer.Default; Assert.IsTrue (comparer.Equals (null, null)); } + + [Test] + public void EnumComparison () + { + Assert.IsFalse (EqualityComparer.Default.Equals (E.A, E.B)); + Assert.IsFalse (EqualityComparer.Default.Equals (E.A, E.B)); + } } } diff --git a/mcs/class/corlib/Test/System/TimeZoneInfo.AdjustmentRuleTest.cs b/mcs/class/corlib/Test/System/TimeZoneInfo.AdjustmentRuleTest.cs index 940b1290ea3..62ae67cfc81 100644 --- a/mcs/class/corlib/Test/System/TimeZoneInfo.AdjustmentRuleTest.cs +++ b/mcs/class/corlib/Test/System/TimeZoneInfo.AdjustmentRuleTest.cs @@ -55,16 +55,17 @@ namespace MonoTests.System } [Test] - [ExpectedException (typeof (ArgumentOutOfRangeException))] public void EndBeforeStart () { - if (Environment.OSVersion.Platform != PlatformID.Unix) - throw new ArgumentOutOfRangeException ();; DateTime dateStart = new DateTime (2007,01,01); DateTime dateEnd = new DateTime (2006,01,01); TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11); TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11); - TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd); + try { + TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (1,0,0), daylightTransitionStart, daylightTransitionEnd); + Assert.Fail (); + } catch (ArgumentException) { + } } [Test] @@ -79,7 +80,6 @@ namespace MonoTests.System } [Test] - [ExpectedException (typeof (ArgumentOutOfRangeException))] public void DeltaNotInSeconds () { if (Environment.OSVersion.Platform != PlatformID.Unix) @@ -88,7 +88,11 @@ namespace MonoTests.System DateTime dateEnd = new DateTime (2008,01,01); TimeZoneInfo.TransitionTime daylightTransitionStart = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 03, 11); TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11); - TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd); + try { + TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd); + Assert.Fail (); + } catch (ArgumentException) { + } } } diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index dac61c579b8..98ab6f9cf26 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -88,27 +88,16 @@ System/AppDomain.cs System/AppDomainInitializer.cs System/AppDomainManager.cs System/AppDomainSetup.cs -System/ApplicationId.cs System/ApplicationIdentity.cs System/ArgIterator.cs System/Array.cs System/AssemblyLoadEventArgs.cs System/AssemblyLoadEventHandler.cs -System/AsyncCallback.cs -System/Buffer.cs System/CStreamReader.cs System/CStreamWriter.cs System/Console.cs System/Console.iOS.cs -System/ConsoleCancelEventArgs.cs -System/ConsoleCancelEventHandler.cs -System/ConsoleColor.cs System/ConsoleDriver.cs -System/ConsoleKey.cs -System/ConsoleKeyInfo.cs -System/ConsoleModifiers.cs -System/ConsoleSpecialKey.cs -System/ContextBoundObject.cs System/ControlCharacters.cs System/CrossAppDomainDelegate.cs System/Delegate.cs @@ -118,32 +107,14 @@ System/Double.cs System/EmptyArray.cs System/Environment.cs System/EnvironmentVariableTarget.cs -System/EventArgs.cs -System/EventHandler.cs System/Exception.cs -System/Funcs.cs System/GC.cs System/GCCollectionMode.cs System/GCNotificationStatus.cs System/Guid.cs System/Guid.MonoTouch.cs -System/IAppDomainSetup.cs -System/IAsyncResult.cs -System/IObservable.cs -System/IObserver.cs -System/ICloneable.cs -System/IComparable.cs -System/IEquatable.cs System/IConsoleDriver.cs -System/IConvertible.cs -System/ICustomFormatter.cs -System/IDisposable.cs -System/IFormatProvider.cs -System/IFormattable.cs System/IntPtr.cs -System/InvalidTimeZoneException.cs -System/IProgress.cs -System/IServiceProvider.cs System/KnownTerminals.cs System/LocalDataStoreSlot.cs System/MarshalByRefObject.cs @@ -177,12 +148,9 @@ System/TermInfoReader.cs System/TermInfoStrings.cs System/TimeZone.cs System/TimeZoneInfo.cs -System/TimeZoneInfo.AdjustmentRule.cs System/TimeZoneInfo.Android.cs System/TimeZoneInfo.MonoTouch.cs System/TimeZoneInfo.Serialization.cs -System/TimeZoneInfo.TransitionTime.cs -System/TimeZoneNotFoundException.cs ../../build/common/MonoTODOAttribute.cs System/TypeSpec.cs System/TypeCode.cs @@ -193,7 +161,6 @@ System/Void.cs System/WeakReference.cs System/WeakReference_T.cs System/WindowsConsoleDriver.cs -System/_AppDomain.cs System/__ComObject.cs System.Configuration.Assemblies/AssemblyHash.cs System.Configuration.Assemblies/AssemblyHashAlgorithm.cs @@ -1132,12 +1099,6 @@ System.Threading/Timer.cs System.Threading/TimerCallback.cs System.Threading/Volatile.cs System.Threading/WaitHandle.cs -System/Action.cs -System/Comparison.cs -System/Converter.cs -System/Predicate.cs -System.Collections.Generic/Comparer.cs -System.Collections.Generic/EqualityComparer.cs System.Threading.Tasks/DecoupledTask.cs ../Mono.Parallel/Mono.Threading/AtomicBoolean.cs @@ -1154,7 +1115,6 @@ ReferenceSources/Environment.cs ReferenceSources/ExecutionContext.cs ReferenceSources/HashHelpers.cs ReferenceSources/ParseNumbers.cs -ReferenceSources/TimeZoneInfoOptions.cs ReferenceSources/AppDomain.cs ReferenceSources/CLRConfig.cs ReferenceSources/JitHelpers.cs @@ -1167,31 +1127,44 @@ ReferenceSources/MonoRuntimeWorkItem.cs ReferenceSources/MethodBase.cs ReferenceSources/RuntimeHandles.cs ReferenceSources/CompareInfo.cs +ReferenceSources/TypeBuilderInstantiation.cs +ReferenceSources/Buffer.cs ../../../external/referencesource/mscorlib/system/__filters.cs ../../../external/referencesource/mscorlib/system/__hresults.cs ../../../external/referencesource/mscorlib/system/accessviolationexception.cs +../../../external/referencesource/mscorlib/system/action.cs ../../../external/referencesource/mscorlib/system/activator.cs ../../../external/referencesource/mscorlib/system/AggregateException.cs ../../../external/referencesource/mscorlib/system/appdomainattributes.cs ../../../external/referencesource/mscorlib/system/appdomainunloadedexception.cs ../../../external/referencesource/mscorlib/system/applicationexception.cs +../../../external/referencesource/mscorlib/system/applicationid.cs ../../../external/referencesource/mscorlib/system/argumentexception.cs ../../../external/referencesource/mscorlib/system/argumentnullexception.cs ../../../external/referencesource/mscorlib/system/argumentoutofrangeexception.cs ../../../external/referencesource/mscorlib/system/arithmeticexception.cs ../../../external/referencesource/mscorlib/system/arraysegment.cs ../../../external/referencesource/mscorlib/system/arraytypemismatchexception.cs +../../../external/referencesource/mscorlib/system/asynccallback.cs ../../../external/referencesource/mscorlib/system/attribute.cs ../../../external/referencesource/mscorlib/system/attributetargets.cs ../../../external/referencesource/mscorlib/system/attributeusageattribute.cs ../../../external/referencesource/mscorlib/system/badimageformatexception.cs ../../../external/referencesource/mscorlib/system/bitconverter.cs ../../../external/referencesource/mscorlib/system/boolean.cs +../../../external/referencesource/mscorlib/system/buffer.cs ../../../external/referencesource/mscorlib/system/byte.cs ../../../external/referencesource/mscorlib/system/cannotunloadappdomainexception.cs ../../../external/referencesource/mscorlib/system/char.cs ../../../external/referencesource/mscorlib/system/charenumerator.cs +../../../external/referencesource/mscorlib/system/consolecanceleventargs.cs +../../../external/referencesource/mscorlib/system/consolecolor.cs +../../../external/referencesource/mscorlib/system/consolekey.cs +../../../external/referencesource/mscorlib/system/consolekeyinfo.cs +../../../external/referencesource/mscorlib/system/consolemodifiers.cs +../../../external/referencesource/mscorlib/system/consolespecialkey.cs +../../../external/referencesource/mscorlib/system/contextboundobject.cs ../../../external/referencesource/mscorlib/system/contextstaticattribute.cs ../../../external/referencesource/mscorlib/system/clscompliantattribute.cs ../../../external/referencesource/mscorlib/system/contextmarshalexception.cs @@ -1210,11 +1183,24 @@ ReferenceSources/CompareInfo.cs ../../../external/referencesource/mscorlib/system/empty.cs ../../../external/referencesource/mscorlib/system/enum.cs ../../../external/referencesource/mscorlib/system/entrypointnotfoundexception.cs +../../../external/referencesource/mscorlib/system/eventargs.cs +../../../external/referencesource/mscorlib/system/eventhandler.cs ../../../external/referencesource/mscorlib/system/executionengineexception.cs ../../../external/referencesource/mscorlib/system/fieldaccessexception.cs ../../../external/referencesource/mscorlib/system/flagsattribute.cs ../../../external/referencesource/mscorlib/system/formatexception.cs ../../../external/referencesource/mscorlib/system/guid.cs +../../../external/referencesource/mscorlib/system/iappdomain.cs +../../../external/referencesource/mscorlib/system/iappdomainsetup.cs +../../../external/referencesource/mscorlib/system/iasyncresult.cs +../../../external/referencesource/mscorlib/system/icloneable.cs +../../../external/referencesource/mscorlib/system/icomparable.cs +../../../external/referencesource/mscorlib/system/iconvertible.cs +../../../external/referencesource/mscorlib/system/icustomformatter.cs +../../../external/referencesource/mscorlib/system/idisposable.cs +../../../external/referencesource/mscorlib/system/iequatable.cs +../../../external/referencesource/mscorlib/system/iformatprovider.cs +../../../external/referencesource/mscorlib/system/iformattable.cs ../../../external/referencesource/mscorlib/system/invalidcastexception.cs ../../../external/referencesource/mscorlib/system/indexoutofrangeexception.cs ../../../external/referencesource/mscorlib/system/invalidoperationexception.cs @@ -1224,9 +1210,15 @@ ReferenceSources/CompareInfo.cs ../../../external/referencesource/mscorlib/system/int16.cs ../../../external/referencesource/mscorlib/system/int32.cs ../../../external/referencesource/mscorlib/system/int64.cs +../../../external/referencesource/mscorlib/system/iobservable.cs +../../../external/referencesource/mscorlib/system/iobserver.cs +../../../external/referencesource/mscorlib/system/iprogress.cs +../../../external/referencesource/mscorlib/system/iserviceobjectprovider.cs +../../../external/referencesource/mscorlib/system/invalidtimezoneexception.cs ../../../external/referencesource/mscorlib/system/Lazy.cs ../../../external/referencesource/mscorlib/system/memberaccessexception.cs ../../../external/referencesource/mscorlib/system/methodaccessexception.cs +../../../external/referencesource/mscorlib/system/midpointrounding.cs ../../../external/referencesource/mscorlib/system/missingfieldexception.cs ../../../external/referencesource/mscorlib/system/missingmemberexception.cs ../../../external/referencesource/mscorlib/system/missingmethodexception.cs @@ -1235,7 +1227,6 @@ ReferenceSources/CompareInfo.cs ../../../external/referencesource/mscorlib/system/notfinitenumberexception.cs ../../../external/referencesource/mscorlib/system/notimplementedexception.cs ../../../external/referencesource/mscorlib/system/notsupportedexception.cs -../../../external/referencesource/mscorlib/system/midpointrounding.cs ../../../external/referencesource/mscorlib/system/nullreferenceexception.cs ../../../external/referencesource/mscorlib/system/number.cs ../../../external/referencesource/mscorlib/system/objectdisposedexception.cs @@ -1262,6 +1253,8 @@ ReferenceSources/CompareInfo.cs ../../../external/referencesource/mscorlib/system/threadattributes.cs ../../../external/referencesource/mscorlib/system/threadstaticattribute.cs ../../../external/referencesource/mscorlib/system/throwhelper.cs +../../../external/referencesource/mscorlib/system/timezoneinfo.cs +../../../external/referencesource/mscorlib/system/timezonenotfoundexception.cs ../../../external/referencesource/mscorlib/system/tuple.cs ../../../external/referencesource/mscorlib/system/type.cs ../../../external/referencesource/mscorlib/system/typeaccessexception.cs @@ -1313,8 +1306,10 @@ ReferenceSources/CompareInfo.cs ../../../external/referencesource/mscorlib/system/collections/stack.cs ../../../external/referencesource/mscorlib/system/collections/structuralcomparisons.cs +../../../external/referencesource/mscorlib/system/collections/generic/comparer.cs ../../../external/referencesource/mscorlib/system/collections/generic/debugview.cs ../../../external/referencesource/mscorlib/system/collections/generic/dictionary.cs +../../../external/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs ../../../external/referencesource/mscorlib/system/collections/generic/icollection.cs ../../../external/referencesource/mscorlib/system/collections/generic/icomparer.cs ../../../external/referencesource/mscorlib/system/collections/generic/idictionary.cs @@ -1541,6 +1536,8 @@ ReferenceSources/CompareInfo.cs ../../../external/referencesource/mscorlib/system/runtime/compilerservices/unsafevaluetypeattribute.cs ../../../external/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs +../../../external/referencesource/mscorlib/system/security/util/hex.cs + ../../../external/referencesource/mscorlib/system/text/asciiencoding.cs ../../../external/referencesource/mscorlib/system/text/codepageencoding.cs ../../../external/referencesource/mscorlib/system/text/decoderbestfitfallback.cs diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c index b959cb96b04..c6d3071d05b 100644 --- a/mono/metadata/appdomain.c +++ b/mono/metadata/appdomain.c @@ -78,7 +78,7 @@ * Changes which are already detected at runtime, like the addition * of icalls, do not require an increment. */ -#define MONO_CORLIB_VERSION 125 +#define MONO_CORLIB_VERSION 127 typedef struct { diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h index dba88a9bf34..d2b6722e173 100644 --- a/mono/metadata/class-internals.h +++ b/mono/metadata/class-internals.h @@ -1090,6 +1090,7 @@ typedef struct { MonoClass *methodhandle_class; MonoClass *systemtype_class; MonoClass *monotype_class; + MonoClass *runtimetype_class; MonoClass *exception_class; MonoClass *threadabortexception_class; MonoClass *thread_class; diff --git a/mono/metadata/domain.c b/mono/metadata/domain.c index e791b07ce2b..d2d92fd51c9 100755 --- a/mono/metadata/domain.c +++ b/mono/metadata/domain.c @@ -713,6 +713,10 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * mono_defaults.corlib, "System", "MonoType"); g_assert (mono_defaults.monotype_class != 0); + mono_defaults.runtimetype_class = mono_class_from_name ( + mono_defaults.corlib, "System", "RuntimeType"); + g_assert (mono_defaults.runtimetype_class != 0); + mono_defaults.exception_class = mono_class_from_name ( mono_defaults.corlib, "System", "Exception"); g_assert (mono_defaults.exception_class != 0); diff --git a/mono/metadata/file-mmap-posix.c b/mono/metadata/file-mmap-posix.c index e4b2bd75d6d..227b3cc9697 100644 --- a/mono/metadata/file-mmap-posix.c +++ b/mono/metadata/file-mmap-posix.c @@ -9,7 +9,7 @@ #include -#ifndef TARGET_WIN32 +#ifndef HOST_WIN32 #include #include diff --git a/mono/metadata/file-mmap-windows.c b/mono/metadata/file-mmap-windows.c index 78203ad47a8..56d598ee7f2 100644 --- a/mono/metadata/file-mmap-windows.c +++ b/mono/metadata/file-mmap-windows.c @@ -9,7 +9,7 @@ #include -#ifdef TARGET_WIN32 +#ifdef HOST_WIN32 #include #include diff --git a/mono/metadata/icall-def.h b/mono/metadata/icall-def.h index 7537498b0c4..530ad048095 100644 --- a/mono/metadata/icall-def.h +++ b/mono/metadata/icall-def.h @@ -105,10 +105,10 @@ ICALL(ARRAY_12, "SetValue", ves_icall_System_Array_SetValue) ICALL(ARRAY_13, "SetValueImpl", ves_icall_System_Array_SetValueImpl) ICALL_TYPE(BUFFER, "System.Buffer", BUFFER_1) -ICALL(BUFFER_1, "BlockCopyInternal", ves_icall_System_Buffer_BlockCopyInternal) -ICALL(BUFFER_2, "ByteLengthInternal", ves_icall_System_Buffer_ByteLengthInternal) -ICALL(BUFFER_3, "GetByteInternal", ves_icall_System_Buffer_GetByteInternal) -ICALL(BUFFER_4, "SetByteInternal", ves_icall_System_Buffer_SetByteInternal) +ICALL(BUFFER_1, "InternalBlockCopy", ves_icall_System_Buffer_BlockCopyInternal) +ICALL(BUFFER_2, "_ByteLength", ves_icall_System_Buffer_ByteLengthInternal) +ICALL(BUFFER_3, "_GetByte", ves_icall_System_Buffer_GetByteInternal) +ICALL(BUFFER_4, "_SetByte", ves_icall_System_Buffer_SetByteInternal) ICALL_TYPE (COMPO_W, "System.ComponentModel.Win32Exception", COMPO_W_1) ICALL (COMPO_W_1, "W32ErrorMessage", ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage) @@ -733,7 +733,7 @@ ICALL(RT_1, "CreateInstanceInternal", ves_icall_System_Activator_CreateInstanceI ICALL(RT_2, "GetConstructors_internal", ves_icall_Type_GetConstructors_internal) ICALL(RT_3, "GetEvents_internal", ves_icall_Type_GetEvents_internal) ICALL(RT_5, "GetFields_internal", ves_icall_Type_GetFields_internal) -ICALL(RT_6, "GetGenericArguments", ves_icall_MonoType_GetGenericArguments) +ICALL(RT_6, "GetGenericArgumentsInternal", ves_icall_MonoType_GetGenericArguments) ICALL(RT_7, "GetGenericParameterAttributes", ves_icall_Type_GetGenericParameterAttributes) ICALL(RT_8, "GetGenericParameterConstraints_impl", ves_icall_Type_GetGenericParameterConstraints) ICALL(RT_9, "GetGenericParameterPosition", ves_icall_Type_GetGenericParameterPosition) diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index 056e76eada4..1132dbfeb0f 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -2293,31 +2293,38 @@ ves_icall_MonoType_GetArrayRank (MonoReflectionType *type) return class->rank; } +static MonoArray* +create_type_array (MonoDomain *domain, MonoBoolean runtimeTypeArray, int count) +{ + MonoArray *res; + res = mono_array_new (domain, runtimeTypeArray ? mono_defaults.runtimetype_class : mono_defaults.systemtype_class, count); + return res; +} + ICALL_EXPORT MonoArray* -ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type) +ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type, MonoBoolean runtimeTypeArray) { MonoArray *res; MonoClass *klass, *pklass; MonoDomain *domain = mono_object_domain (type); - MonoVTable *array_vtable = mono_class_vtable_full (domain, mono_array_class_get_cached (mono_defaults.systemtype_class, 1), TRUE); int i; klass = mono_class_from_mono_type (type->type); if (klass->generic_container) { MonoGenericContainer *container = klass->generic_container; - res = mono_array_new_specific (array_vtable, container->type_argc); + res = create_type_array (domain, runtimeTypeArray, container->type_argc); for (i = 0; i < container->type_argc; ++i) { pklass = mono_class_from_generic_parameter (mono_generic_container_get_param (container, i), klass->image, FALSE); mono_array_setref (res, i, mono_type_get_object (domain, &pklass->byval_arg)); } } else if (klass->generic_class) { MonoGenericInst *inst = klass->generic_class->context.class_inst; - res = mono_array_new_specific (array_vtable, inst->type_argc); + res = create_type_array (domain, runtimeTypeArray, inst->type_argc); for (i = 0; i < inst->type_argc; ++i) mono_array_setref (res, i, mono_type_get_object (domain, inst->type_argv [i])); } else { - res = mono_array_new_specific (array_vtable, 0); + res = NULL; } return res; } @@ -6996,8 +7003,8 @@ mono_TypedReference_MakeTypedReferenceInternal (MonoObject *target, MonoArray *f MonoTypedRef res; MonoReflectionField *f; MonoClass *klass; - MonoType *ftype; - guint8 *p; + MonoType *ftype = NULL; + guint8 *p = NULL; int i; memset (&res, 0, sizeof (res)); diff --git a/mono/metadata/threadpool-ms-io.c b/mono/metadata/threadpool-ms-io.c index e92caac8682..772a2fe5c6c 100644 --- a/mono/metadata/threadpool-ms-io.c +++ b/mono/metadata/threadpool-ms-io.c @@ -259,7 +259,7 @@ epoll_init (void) #ifdef EPOOL_CLOEXEC threadpool_io->epoll.fd = epoll_create1 (EPOLL_CLOEXEC); #else - threadpool_io->epoll.fd = epoll_create1 (256); + threadpool_io->epoll.fd = epoll_create (256); fcntl (threadpool_io->epoll.fd, F_SETFD, FD_CLOEXEC); #endif diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index bd0a8e69665..8139f97998c 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -7890,7 +7890,7 @@ emit_exception_info (MonoAotCompile *acfg) // By design aot-runtime decode_exception_debug_info is not able to load sequence point debug data from a file. // As it is not possible to load debug data from a file its is also not possible to store it in a file. gboolean method_seq_points_to_file = acfg->aot_opts.gen_seq_points_file && - cfg->gen_seq_points && !cfg->gen_seq_points_debug_data; + cfg->gen_seq_points && !cfg->gen_sdb_seq_points; gboolean method_seq_points_to_binary = cfg->gen_seq_points && !method_seq_points_to_file; emit_exception_debug_info (acfg, cfg, method_seq_points_to_binary); @@ -9236,7 +9236,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options) MonoDebugOptions *opt = mini_get_debug_options (); opt->mdb_optimizations = TRUE; - opt->gen_seq_points_debug_data = TRUE; + opt->gen_sdb_seq_points = TRUE; if (!mono_debug_enabled ()) { aot_printerrf (acfg, "The soft-debug AOT option requires the --debug option.\n"); diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c index c4047274cbf..056985fc26f 100644 --- a/mono/mini/aot-runtime.c +++ b/mono/mini/aot-runtime.c @@ -860,7 +860,10 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod int atype = decode_value (p, &p); ref->method = mono_gc_get_managed_allocator_by_type (atype); - g_assert (ref->method); + if (!ref->method) { + fprintf (stderr, "Error: No managed allocator, but we need one for AOT.\nAre you using non-standard GC options?\n"); + exit (1); + } break; } case MONO_WRAPPER_WRITE_BARRIER: diff --git a/mono/mini/cpu-s390x.md b/mono/mini/cpu-s390x.md index bc1a513d40b..091c6b1103d 100644 --- a/mono/mini/cpu-s390x.md +++ b/mono/mini/cpu-s390x.md @@ -132,9 +132,9 @@ float_rem_un: dest:f src1:f src2:f len:16 float_sub: dest:f src1:f src2:f len:6 fmove: dest:f src1:f len:4 move_f_to_i4: dest:i src1:f len:4 -move_i4_to_f: dest:f src1:i len:4 +move_i4_to_f: dest:f src1:i len:8 move_f_to_i8: dest:i src1:f len:4 -move_i8_to_f: dest:f src1:i len:4 +move_i8_to_f: dest:f src1:i len:8 i8const: dest:i len:20 icompare: src1:i src2:i len:4 icompare_imm: src1:i len:18 diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index fbc149244f0..6e07d05e5da 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -1032,7 +1032,7 @@ mono_debugger_agent_init (void) breakpoints_init (); suspend_init (); - mini_get_debug_options ()->gen_seq_points_debug_data = TRUE; + mini_get_debug_options ()->gen_sdb_seq_points = TRUE; /* * This is needed because currently we don't handle liveness info. */ @@ -2309,7 +2309,7 @@ decode_ptr_id (guint8 *buf, guint8 **endbuf, guint8 *limit, IdType type, MonoDom dbg_unlock (); if (res->domain == NULL) { - DEBUG_PRINTF (0, "ERR_UNLOADED, id=%d, type=%d.\n", id, type); + DEBUG_PRINTF (1, "ERR_UNLOADED, id=%d, type=%d.\n", id, type); *err = ERR_UNLOADED; return NULL; } @@ -5324,6 +5324,18 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI if (ss_req->nframes == 0) ss_req->nframes = nframes; + + if ((ss_req->depth == STEP_DEPTH_OVER) && (!sp && !parent_sp)) { + DEBUG_PRINTF (1, "[dbg] No parent frame for step over, transition to step into.\n"); + /* + * This is needed since if we leave managed code, and later return to it, step over + * is not going to stop. + * This approach is a bit ugly, since we change the step depth, but it only affects + * clients who reuse the same step request, and only in this special case. + */ + ss_req->depth = STEP_DEPTH_INTO; + } + if (ss_req->depth == STEP_DEPTH_OVER) { /* Need to stop in catch clauses as well */ for (i = 0; i < nframes; ++i) { diff --git a/mono/mini/ir-emit.h b/mono/mini/ir-emit.h index 67d073448d3..fe05ecca2d3 100644 --- a/mono/mini/ir-emit.h +++ b/mono/mini/ir-emit.h @@ -408,7 +408,7 @@ handle_gsharedvt_ldaddr (MonoCompile *cfg) } while (0) #define NEW_SEQ_POINT(cfg,dest,il_offset,intr_loc) do { \ - MONO_INST_NEW ((cfg), (dest), cfg->gen_seq_points_debug_data ? OP_SEQ_POINT : OP_IL_SEQ_POINT); \ + MONO_INST_NEW ((cfg), (dest), cfg->gen_sdb_seq_points ? OP_SEQ_POINT : OP_IL_SEQ_POINT); \ (dest)->inst_imm = (il_offset); \ (dest)->flags = intr_loc ? MONO_INST_SINGLE_STEP_LOC : 0; \ } while (0) diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 89c24195770..e87a9deeca5 100755 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -2998,7 +2998,7 @@ direct_icalls_enabled (MonoCompile *cfg) if (cfg->compile_llvm) return FALSE; #endif - if (cfg->gen_seq_points_debug_data || cfg->disable_direct_icalls) + if (cfg->gen_sdb_seq_points || cfg->disable_direct_icalls) return FALSE; return TRUE; } @@ -7798,16 +7798,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b cfg->stat_cil_code_size += header->code_size; seq_points = cfg->gen_seq_points && cfg->method == method; -#ifdef PLATFORM_ANDROID - seq_points &= cfg->method->wrapper_type == MONO_WRAPPER_NONE; -#endif if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) { /* We could hit a seq point before attaching to the JIT (#8338) */ seq_points = FALSE; } - if (cfg->gen_seq_points_debug_data && cfg->method == method) { + if (cfg->gen_sdb_seq_points && cfg->method == method) { minfo = mono_debug_lookup_method (method); if (minfo) { int i, n_il_offsets; @@ -13074,7 +13071,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } /* Add a sequence point for method entry/exit events */ - if (seq_points && cfg->gen_seq_points_debug_data) { + if (seq_points && cfg->gen_sdb_seq_points) { NEW_SEQ_POINT (cfg, ins, METHOD_ENTRY_IL_OFFSET, FALSE); MONO_ADD_INS (init_localsbb, ins); NEW_SEQ_POINT (cfg, ins, METHOD_EXIT_IL_OFFSET, FALSE); diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c index cd1070c42f0..f43fe603302 100755 --- a/mono/mini/mini-amd64.c +++ b/mono/mini/mini-amd64.c @@ -52,7 +52,7 @@ static gboolean optimize_for_xen = TRUE; #define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f)) -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 /* Under windows, the calling convention is never stdcall */ #define CALLCONV_IS_STDCALL(call_conv) (FALSE) #else @@ -526,7 +526,7 @@ typedef struct { #define DEBUG(a) if (cfg->verbose_level > 1) a -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 static AMD64_Reg_No param_regs [] = { AMD64_RCX, AMD64_RDX, AMD64_R8, AMD64_R9 }; static AMD64_Reg_No return_regs [] = { AMD64_RAX, AMD64_RDX }; @@ -554,7 +554,7 @@ add_general (guint32 *gr, guint32 *stack_size, ArgInfo *ainfo) } } -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 #define FLOAT_PARAM_REGS 4 #else #define FLOAT_PARAM_REGS 8 @@ -618,7 +618,7 @@ merge_argument_class_from_type (MonoGenericSharingContext *gsctx, MonoType *type break; case MONO_TYPE_R4: case MONO_TYPE_R8: -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 class2 = ARG_CLASS_INTEGER; #else class2 = ARG_CLASS_SSE; @@ -751,7 +751,7 @@ add_valuetype (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig, ArgIn klass = mono_class_from_mono_type (type); size = mini_type_stack_size_full (gsctx, &klass->byval_arg, NULL, sig->pinvoke); -#ifndef HOST_WIN32 +#ifndef TARGET_WIN32 if (!sig->pinvoke && ((is_return && (size == 8)) || (!is_return && (size <= 16)))) { /* We pass and return vtypes of size 8 in a register */ } else if (!sig->pinvoke || (size == 0) || (size > 16)) { @@ -833,7 +833,7 @@ add_valuetype (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig, ArgIn g_assert (info); g_assert (fields); -#ifndef HOST_WIN32 +#ifndef TARGET_WIN32 if (info->native_size > 16) { ainfo->offset = *stack_size; *stack_size += ALIGN_TO (info->native_size, 8); @@ -1006,7 +1006,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign gr = 0; fr = 0; -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 /* Reserve space where the callee can save the argument registers */ stack_size = 4 * sizeof (mgreg_t); #endif @@ -1115,7 +1115,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign ArgInfo *ainfo = &cinfo->args [sig->hasthis + i]; MonoType *ptype; -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 /* The float param registers and other param registers must be the same index on Windows x64.*/ if (gr > fr) fr = gr; @@ -1540,7 +1540,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) #ifndef __native_client_codegen__ regs = g_list_prepend (regs, (gpointer)AMD64_R15); #endif -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 regs = g_list_prepend (regs, (gpointer)AMD64_RDI); regs = g_list_prepend (regs, (gpointer)AMD64_RSI); #endif @@ -2008,7 +2008,7 @@ mono_arch_create_vars (MonoCompile *cfg) } } - if (cfg->gen_seq_points_debug_data) { + if (cfg->gen_sdb_seq_points) { MonoInst *ins; if (cfg->compile_aot) { @@ -2031,7 +2031,7 @@ mono_arch_create_vars (MonoCompile *cfg) if (cfg->method->save_lmf) { cfg->lmf_ir = TRUE; -#if !defined(HOST_WIN32) +#if !defined(TARGET_WIN32) if (mono_get_lmf_tls_offset () != -1 && !optimize_for_xen) cfg->lmf_ir_mono_lmf = TRUE; #endif @@ -3002,12 +3002,12 @@ emit_call_body (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointe static inline guint8* emit_call (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer data, gboolean win64_adjust_stack) { -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 if (win64_adjust_stack) amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 32); #endif code = emit_call_body (cfg, code, patch_type, data); -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 if (win64_adjust_stack) amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 32); #endif @@ -3347,7 +3347,7 @@ mono_emit_stack_alloc (MonoCompile *cfg, guchar *code, MonoInst* tree) int sreg = tree->sreg1; int need_touch = FALSE; -#if defined(HOST_WIN32) +#if defined(TARGET_WIN32) need_touch = TRUE; #elif defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK) if (!tree->flags & MONO_INST_INIT) @@ -3591,7 +3591,7 @@ mono_amd64_get_tls_gs_offset (void) guint8* mono_amd64_emit_tls_get (guint8* code, int dreg, int tls_offset) { -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 if (tls_offset < 64) { x86_prefix (code, X86_GS_PREFIX); amd64_mov_reg_mem (code, dreg, (tls_offset * 8) + 0x1480, 8); @@ -3657,7 +3657,7 @@ emit_tls_get_reg (guint8* code, int dreg, int offset_reg) static guint8* amd64_emit_tls_set (guint8 *code, int sreg, int tls_offset) { -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 g_assert_not_reached (); #elif defined(__APPLE__) x86_prefix (code, X86_GS_PREFIX); @@ -3674,7 +3674,7 @@ static guint8* amd64_emit_tls_set_reg (guint8 *code, int sreg, int offset_reg) { /* offset_reg contains a value translated by mono_arch_translate_tls_offset () */ -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 g_assert_not_reached (); #elif defined(__APPLE__) x86_prefix (code, X86_GS_PREFIX); @@ -6774,7 +6774,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset); mono_emit_unwind_op_offset (cfg, code, AMD64_RBP, - cfa_offset); async_exc_point (code); -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 mono_arch_unwindinfo_add_push_nonvol (&cfg->arch.unwindinfo, cfg->native_code, code, AMD64_RBP); #endif /* These are handled automatically by the stack marking code */ @@ -6783,7 +6783,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, sizeof(mgreg_t)); mono_emit_unwind_op_def_cfa_reg (cfg, code, AMD64_RBP); async_exc_point (code); -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 mono_arch_unwindinfo_add_set_fpreg (&cfg->arch.unwindinfo, cfg->native_code, code, AMD64_RBP); #endif } @@ -6824,7 +6824,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* Allocate stack frame */ if (alloc_size) { /* See mono_emit_stack_alloc */ -#if defined(HOST_WIN32) || defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK) +#if defined(TARGET_WIN32) || defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK) guint32 remaining_size = alloc_size; /*FIXME handle unbounded code expansion, we should use a loop in case of more than X interactions*/ guint32 required_code_size = ((remaining_size / 0x1000) + 1) * 10; /*10 is the max size of amd64_alu_reg_imm + amd64_test_membase_reg*/ @@ -6844,7 +6844,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset); } async_exc_point (code); -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 if (cfg->arch.omit_fp) mono_arch_unwindinfo_add_alloc_stack (&cfg->arch.unwindinfo, cfg->native_code, code, 0x1000); #endif @@ -6859,7 +6859,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset); async_exc_point (code); } -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 if (cfg->arch.omit_fp) mono_arch_unwindinfo_add_alloc_stack (&cfg->arch.unwindinfo, cfg->native_code, code, remaining_size); #endif @@ -7213,7 +7213,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) } } - if (cfg->gen_seq_points_debug_data) { + if (cfg->gen_sdb_seq_points) { MonoInst *info_var = cfg->arch.seq_point_info_var; /* Initialize seq_point_info_var */ @@ -7953,7 +7953,7 @@ get_delegate_invoke_impl (gboolean has_target, guint32 param_count, guint32 *cod /* We have to shift the arguments left */ amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8); for (i = 0; i < param_count; ++i) { -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 if (i < 3) amd64_mov_reg_reg (code, param_regs [i], param_regs [i + 1], 8); else diff --git a/mono/mini/mini-amd64.h b/mono/mini/mini-amd64.h index 1b48c14caa6..92917877e2a 100644 --- a/mono/mini/mini-amd64.h +++ b/mono/mini/mini-amd64.h @@ -213,7 +213,7 @@ typedef struct MonoCompileArch { -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 #define PARAM_REGS 4 #else #define PARAM_REGS 6 @@ -287,7 +287,7 @@ typedef struct { #define MONO_ARCH_NOMAP32BIT 1 #endif -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 #define MONO_AMD64_ARG_REG1 AMD64_RCX #define MONO_AMD64_ARG_REG2 AMD64_RDX #define MONO_AMD64_ARG_REG3 AMD64_R8 @@ -410,7 +410,7 @@ typedef struct { extern MonoBreakpointInfo mono_breakpoint_info [MONO_BREAKPOINT_ARRAY_SIZE]; -#ifdef HOST_WIN32 +#ifdef TARGET_WIN32 void mono_arch_unwindinfo_add_push_nonvol (gpointer* monoui, gpointer codebegin, gpointer nextip, guchar reg ); void mono_arch_unwindinfo_add_set_fpreg (gpointer* monoui, gpointer codebegin, gpointer nextip, guchar reg ); diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c index 3a12ed0329f..4ed7342572c 100644 --- a/mono/mini/mini-arm.c +++ b/mono/mini/mini-arm.c @@ -2154,7 +2154,7 @@ mono_arch_create_vars (MonoCompile *cfg) } } - if (cfg->gen_seq_points_debug_data) { + if (cfg->gen_sdb_seq_points) { if (cfg->soft_breakpoints) { MonoInst *ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL); ins->flags |= MONO_INST_VOLATILE; diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index 215bbf53283..8fec989a9fb 100755 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -2664,7 +2664,7 @@ mini_parse_debug_options (void) else if (!strcmp (arg, "explicit-null-checks")) debug_options.explicit_null_checks = TRUE; else if (!strcmp (arg, "gen-seq-points")) - debug_options.gen_seq_points_debug_data = TRUE; + debug_options.gen_sdb_seq_points = TRUE; else if (!strcmp (arg, "gen-compact-seq-points")) debug_options.gen_seq_points_compact_data = TRUE; else if (!strcmp (arg, "init-stacks")) diff --git a/mono/mini/mini.c b/mono/mini/mini.c index 7b36bf8d457..82c756e0985 100755 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -2412,7 +2412,7 @@ mono_codegen (MonoCompile *cfg) if (cfg->opt & MONO_OPT_PEEPHOLE) mono_arch_peephole_pass_2 (cfg, bb); - if (cfg->gen_seq_points && !cfg->gen_seq_points_debug_data) + if (cfg->gen_seq_points && !cfg->gen_sdb_seq_points) bb_deduplicate_op_il_seq_points (cfg, bb); } @@ -3119,8 +3119,16 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl cfg->full_aot = full_aot; cfg->skip_visibility = method->skip_visibility; cfg->orig_method = method; - cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_seq_points_debug_data; - cfg->gen_seq_points_debug_data = debug_options.gen_seq_points_debug_data; + cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_sdb_seq_points; + cfg->gen_sdb_seq_points = debug_options.gen_sdb_seq_points; + +#ifdef PLATFORM_ANDROID + if (cfg->method->wrapper_type != MONO_WRAPPER_NONE) { + /* FIXME: Why is this needed */ + cfg->gen_seq_points = FALSE; + cfg->gen_sdb_seq_points = FALSE; + } +#endif cfg->explicit_null_checks = debug_options.explicit_null_checks; cfg->soft_breakpoints = debug_options.soft_breakpoints; diff --git a/mono/mini/mini.h b/mono/mini/mini.h index 4f57200d16d..148158b3f47 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -105,7 +105,7 @@ #endif /* Version number of the AOT file format */ -#define MONO_AOT_FILE_VERSION 110 +#define MONO_AOT_FILE_VERSION 111 //TODO: This is x86/amd64 specific. #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6)) @@ -1518,7 +1518,7 @@ typedef struct { guint keep_cil_nops : 1; guint gen_seq_points : 1; /* Generate seq points for use by the debugger */ - guint gen_seq_points_debug_data : 1; + guint gen_sdb_seq_points : 1; guint explicit_null_checks : 1; guint compute_gc_maps : 1; guint soft_breakpoints : 1; @@ -1884,7 +1884,7 @@ typedef struct { * Whenever data such as next sequence points and flags is required. * Next sequence points and flags are required by the debugger agent. */ - gboolean gen_seq_points_debug_data; + gboolean gen_sdb_seq_points; gboolean gen_seq_points_compact_data; gboolean explicit_null_checks; /* diff --git a/mono/mini/seq-points.c b/mono/mini/seq-points.c index 26ac63986a3..c0dcd6da7da 100644 --- a/mono/mini/seq-points.c +++ b/mono/mini/seq-points.c @@ -49,7 +49,7 @@ mono_save_seq_point_info (MonoCompile *cfg) GSList **next = NULL; SeqPoint* seq_points; GByteArray* array; - gboolean has_debug_data = cfg->gen_seq_points_debug_data; + gboolean has_debug_data = cfg->gen_sdb_seq_points; if (!cfg->seq_points) return; diff --git a/mono/mini/unwind.c b/mono/mini/unwind.c index 6e95ad6e5d5..17bf3ad8962 100644 --- a/mono/mini/unwind.c +++ b/mono/mini/unwind.c @@ -68,16 +68,11 @@ static int map_hw_reg_to_dwarf_reg [] = { 72, 73, 74, 75, 76, 77, 78, 79, }; #elif defined (TARGET_X86) -#ifdef __APPLE__ /* - * LLVM seems to generate unwind info where esp is encoded as 5, and ebp as 4, ie see this line: - * def ESP : RegisterWithSubRegs<"esp", [SP]>, DwarfRegNum<[-2, 5, 4]>; - * in lib/Target/X86/X86RegisterInfo.td in the llvm sources. + * ebp and esp are swapped: + * http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-January/003101.html */ static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 5, 4, 6, 7, 8 }; -#else -static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; -#endif /* + 1 is for IP */ #define NUM_REGS X86_NREG + 1 #define DWARF_DATA_ALIGN (-4) diff --git a/mono/profiler/Makefile.am b/mono/profiler/Makefile.am index 761989a29bc..115232490c3 100644 --- a/mono/profiler/Makefile.am +++ b/mono/profiler/Makefile.am @@ -91,5 +91,5 @@ else check-local: testlog endif -EXTRA_DIST=utils.c utils.h proflog.h log-profiler.txt perf_event.h \ +EXTRA_DIST=utils.c utils.h proflog.h perf_event.h \ $(PLOG_TESTS_SRC) ptestrunner.pl diff --git a/mono/utils/mono-time.h b/mono/utils/mono-time.h index e4b83e3e7b0..95bda8e5309 100644 --- a/mono/utils/mono-time.h +++ b/mono/utils/mono-time.h @@ -4,6 +4,10 @@ #include #include +#ifdef HAVE_SYS_TIME_H +#include +#endif + /* Returns the number of milliseconds from boot time: this should be monotonic */ guint32 mono_msec_ticks (void); diff --git a/samples/profiler/sample.c b/samples/profiler/sample.c index 49af781a55a..45c46da07d9 100644 --- a/samples/profiler/sample.c +++ b/samples/profiler/sample.c @@ -2,10 +2,15 @@ /* * Bare bones profiler. Compile with: - * gcc -shared -o mono-profiler-sample.so sample.c `pkg-config --cflags --libs mono` - * Install the binary where the dynamic loader can find it. + * + * linux : gcc -shared -o mono-profiler-sample.so sample.c `pkg-config --cflags --libs mono` + * mac : gcc sample.c -o mono-profiler-sample.dylib -Dmono_free=free -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace + * + * Install the binary where the dynamic loader can find it. eg /usr/lib etc * Then run mono with: * mono --profile=sample your_application.exe + * + * Note if you name a profiler with more than 8 characters (eg sample6789) appears to not work */ struct _MonoProfiler { diff --git a/scripts/mono-find-provides.in b/scripts/mono-find-provides.in index c9210060c26..155690d75ad 100644 --- a/scripts/mono-find-provides.in +++ b/scripts/mono-find-provides.in @@ -33,7 +33,7 @@ fi # set LD_LIBRARY_PATH to ensure that libmono is found export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} # and set MONO_PATH to ensure that mscorlib.dll can be found -export MONO_PATH=$prefix/lib/mono/2.0 +export MONO_PATH=$prefix/lib/mono/4.5 for i in "${monolist[@]}"; do ($bindir/monodis --assembly $i | awk ' diff --git a/scripts/mono-find-requires.in b/scripts/mono-find-requires.in index f0ad60bb8a2..d7b6a325bc3 100644 --- a/scripts/mono-find-requires.in +++ b/scripts/mono-find-requires.in @@ -50,7 +50,7 @@ esac # set LD_LIBRARY_PATH to ensure that libmono is found export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} # and set MONO_PATH to ensure that mscorlib.dll can be found -export MONO_PATH=$prefix/lib/mono/2.0 +export MONO_PATH=$prefix/lib/mono/4.5 REQUIRES=$( for i in "${monolist[@]}"; do