Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -81,6 +81,7 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo ("System, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo ("System.Core, PublicKey=00000000000000000400000000000000")]
#endif
[assembly: InternalsVisibleTo ("System.Numerics, PublicKey=00000000000000000400000000000000")]
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]

View File

@@ -5,13 +5,12 @@ export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
LIBRARY = corlib.dll
LIBRARY_NAME = mscorlib.dll
LIB_MCS_FLAGS = $(RESOURCE_FILES:%=-resource:%)
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,PFX_LEGACY_3_5 -d:MONO -d:MONO_HYBRID_ENCODING_SUPPORT,PLATFORM_UNIX
LIB_MCS_FLAGS = $(REFERENCE_SOURCES_FLAGS) $(RESOURCE_FILES:%=-resource:%)
#LIBRARY_USE_INTERMEDIATE_FILE = yes
ifeq (basic, $(PROFILE))
else
ifeq (2, $(FRAMEWORK_VERSION_MAJOR))
LIB_MCS_FLAGS += --runtime:v2
else
@@ -22,12 +21,13 @@ $(error Unknown framework version)
endif
endif
endif
RESOURCE_STRINGS = ../../../external/referencesource/mscorlib/mscorlib.txt
LIBRARY_COMPILE = $(BOOT_COMPILE)
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
RESOURCE_FILES = \
resources/charinfo.nlp \
resources/collation.core.bin \
resources/collation.tailoring.bin \
resources/collation.cjkCHS.bin \
@@ -36,7 +36,15 @@ RESOURCE_FILES = \
resources/collation.cjkKO.bin \
resources/collation.cjkKOlv2.bin
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC
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
MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
ifndef MOBILE_STATIC
REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING
endif
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
DEFAULT_REFERENCES =
# System.IO/DirectoryInfoTest.cs needs Mono.Posix
@@ -160,3 +168,21 @@ EXTRA_DISTFILES += \
$(vtsdir)/VersionTolerantSerializationTestLib/5.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/6.0/Address.cs \
$(vtsdir)/BinarySerializationOverVersions.cs
#
# Android TimeZoneInfo testing....
#
tzi.exe: System/AndroidPlatform.cs $(wildcard System/TimeZone*.cs) ../../build/common/Consts.cs ../../build/common/Locale.cs ../Mono.Options/Mono.Options/Options.cs ReferenceSources/TimeZoneInfoOptions.cs
mcs /debug+ /out:$@ /unsafe "/d:INSIDE_CORLIB;MONODROID;MOBILE;NET_4_5;NET_4_0;LIBC;SELF_TEST" $^
android-pull-tzdb:
mkdir -p android/tzdb/usr/share/zoneinfo
mkdir -p android/tzdb/misc/zoneinfo/zoneinfo
android_root=`adb shell echo '$$ANDROID_ROOT' | tr -d "\r"` ; \
android_data=`adb shell echo '$$ANDROID_DATA' | tr -d "\r"` ; \
adb $(ADB_TARGET) pull $$android_root/usr/share/zoneinfo android/tzdb/usr/share/zoneinfo ; \
adb $(ADB_TARGET) pull $$android_data/misc/zoneinfo/tzdata android/tzdb/misc/zoneinfo
android-dump-tzdata: tzi.exe android-pull-tzdb
__XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT="`pwd`/android/tzdb" ANDROID_DATA="`pwd`/android/tzdb" mono --debug tzi.exe -o android/tzdata

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
using System.IO;
using System.Runtime.InteropServices;
@@ -53,5 +52,4 @@ namespace Microsoft.Win32.SafeHandles {
static extern int RegCloseKey (IntPtr keyHandle);
}
}
#endif

View File

@@ -61,11 +61,9 @@ namespace Microsoft.Win32 {
void SetValue (RegistryKey rkey, string name, object value, RegistryValueKind valueKind);
#if NET_4_0
RegistryKey CreateSubKey (RegistryKey rkey, string keyname, RegistryOptions options);
RegistryKey FromHandle (SafeRegistryHandle handle);
IntPtr GetHandle (RegistryKey key);
#endif
}
}

View File

@@ -46,9 +46,7 @@ namespace Microsoft.Win32
public static readonly RegistryKey CurrentUser = new RegistryKey (
RegistryHive.CurrentUser);
#if NET_4_0
[Obsolete ("Use PerformanceData instead")]
#endif
public static readonly RegistryKey DynData = new RegistryKey (
RegistryHive.DynData);
public static readonly RegistryKey LocalMachine = new RegistryKey (
@@ -93,7 +91,7 @@ namespace Microsoft.Win32
}
for (int i = 1; i < keys.Length; i++){
RegistryKey nkey = key.OpenSubKey (keys [i], true);
RegistryKey nkey = key.OpenSubKey (keys [i], setting);
if (nkey == null){
if (!setting)
return null;

View File

@@ -55,9 +55,7 @@ namespace Microsoft.Win32
// RegistryKey object
//
object handle;
#if NET_4_0
SafeRegistryHandle safe_handle;
#endif
object hive; // the RegistryHive if the key represents a base key
readonly string qname; // the fully qualified registry key name
@@ -110,11 +108,7 @@ namespace Microsoft.Win32
/// Dispose of registry key object. Close the
/// key if it's still open.
/// </summary>
#if NET_4_0
public void Dispose ()
#else
void IDisposable.Dispose ()
#endif
{
GC.SuppressFinalize (this);
Close ();
@@ -163,9 +157,7 @@ namespace Microsoft.Win32
RegistryApi.Close (this);
handle = null;
#if NET_4_0
safe_handle = null;
#endif
}
@@ -192,7 +184,6 @@ namespace Microsoft.Win32
}
}
#if NET_4_0
[ComVisible (false)]
[MonoTODO ("Not implemented in Unix")]
public SafeRegistryHandle Handle {
@@ -215,7 +206,6 @@ namespace Microsoft.Win32
return RegistryView.Default;
}
}
#endif
/// <summary>
@@ -341,7 +331,6 @@ namespace Microsoft.Win32
return CreateSubKey (subkey);
}
#if NET_4_0
[ComVisible (false)]
[MonoLimitation ("permissionCheck is ignored in Mono")]
public RegistryKey CreateSubKey (string subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions options)
@@ -363,7 +352,6 @@ namespace Microsoft.Win32
{
return CreateSubKey (subkey, permissionCheck, registryOptions);
}
#endif
/// <summary>
@@ -415,9 +403,7 @@ namespace Microsoft.Win32
DeleteSubKeyTree (subkey, true);
}
#if NET_4_0
public
#endif
void DeleteSubKeyTree (string subkey, bool throwOnMissingSubKey)
{
// Note: this is done by deleting sub-nodes recursively.
@@ -501,7 +487,6 @@ namespace Microsoft.Win32
return RegistryApi.GetValueNames (this);
}
#if NET_4_0
[ComVisible (false)]
[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
[MonoTODO ("Not implemented on unix")]
@@ -520,7 +505,6 @@ namespace Microsoft.Win32
{
return FromHandle (handle);
}
#endif
[MonoTODO ("Not implemented on unix")]
@@ -531,7 +515,6 @@ namespace Microsoft.Win32
return RegistryApi.OpenRemoteBaseKey (hKey, machineName);
}
#if NET_4_0
[ComVisible (false)]
[MonoTODO ("Not implemented on unix")]
public static RegistryKey OpenRemoteBaseKey (RegistryHive hKey, string machineName, RegistryView view)
@@ -564,7 +547,6 @@ namespace Microsoft.Win32
throw new ArgumentException ("hKey");
}
#endif
[ComVisible (false)]
public RegistryKey OpenSubKey (string name, RegistryKeyPermissionCheck permissionCheck)

View File

@@ -23,7 +23,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
namespace Microsoft.Win32 {
@@ -35,5 +34,4 @@ namespace Microsoft.Win32 {
}
}
#endif

View File

@@ -40,9 +40,7 @@ namespace Microsoft.Win32
DWord,
MultiString = 7,
QWord = 11,
#if NET_4_0
None = -1
#endif
}
}

View File

@@ -23,7 +23,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
namespace Microsoft.Win32 {
@@ -35,5 +34,4 @@ namespace Microsoft.Win32 {
}
}
#endif

View File

@@ -819,12 +819,10 @@ namespace Microsoft.Win32 {
return CreateSubKey (rkey, keyname, true);
}
#if NET_4_0
public RegistryKey CreateSubKey (RegistryKey rkey, string keyname, RegistryOptions options)
{
return CreateSubKey (rkey, keyname, true, options == RegistryOptions.Volatile);
}
#endif
public RegistryKey OpenRemoteBaseKey (RegistryHive hKey, string machineName)
{
@@ -848,12 +846,10 @@ namespace Microsoft.Win32 {
return result;
}
#if NET_4_0
public RegistryKey FromHandle (SafeRegistryHandle handle)
{
throw new NotImplementedException ();
}
#endif
public void Flush (RegistryKey rkey)
{
@@ -991,12 +987,10 @@ namespace Microsoft.Win32 {
return RegistryValueKind.Unknown;
}
#if NET_4_0
public IntPtr GetHandle (RegistryKey key)
{
throw new NotImplementedException ();
}
#endif
}
}

View File

@@ -443,19 +443,16 @@ namespace Microsoft.Win32
{
if (!IsHandleValid (rkey))
return;
#if NET_4_0
SafeRegistryHandle safe_handle = rkey.Handle;
if (safe_handle != null) {
// closes the unmanaged pointer for us.
safe_handle.Close ();
return;
}
#endif
IntPtr handle = GetHandle (rkey);
RegCloseKey (handle);
}
#if NET_4_0
public RegistryKey FromHandle (SafeRegistryHandle handle)
{
// At this point we can't tell whether the key is writable
@@ -463,7 +460,6 @@ namespace Microsoft.Win32
// .Net seems to do.
return new RegistryKey (handle.DangerousGetHandle (), String.Empty, true);
}
#endif
public RegistryKey CreateSubKey (RegistryKey rkey, string keyName)
{
@@ -485,7 +481,6 @@ namespace Microsoft.Win32
true);
}
#if NET_4_0
public RegistryKey CreateSubKey (RegistryKey rkey, string keyName, RegistryOptions options)
{
IntPtr handle = GetHandle (rkey);
@@ -504,7 +499,6 @@ namespace Microsoft.Win32
return new RegistryKey (subKeyHandle, CombineName (rkey, keyName),
true);
}
#endif
public void DeleteKey (RegistryKey rkey, string keyName, bool shouldThrowWhenKeyMissing)
{

View File

@@ -39,6 +39,7 @@
using System;
using System.Collections;
using System.Text;
using System.Collections.Generic;
#pragma warning disable 3021
@@ -462,7 +463,11 @@ namespace Mono {
n = 2;
break;
case '7':
#if PCL
e = Encoding.GetEncoding ("utf-7");
#else
e = Encoding.UTF7;
#endif
n = 1;
break;
case 'b':
@@ -470,11 +475,19 @@ namespace Mono {
n = 2;
break;
case '3':
#if PCL
e = Encoding.GetEncoding ("utf-32");
#else
e = Encoding.GetEncoding (12000);
#endif
n = 4;
break;
case '4':
#if PCL
e = Encoding.GetEncoding ("utf-32BE");
#else
e = Encoding.GetEncoding (12001);
#endif
n = 4;
break;
@@ -510,7 +523,7 @@ namespace Mono {
static public IList Unpack (string description, byte [] buffer, int startIndex)
{
DataConverter conv = CopyConv;
ArrayList result = new ArrayList ();
var result = new List<object> ();
int idx = startIndex;
bool align = false;
int repeat = 0, n;

View File

@@ -0,0 +1,24 @@
using System.Reflection;
using System.Security;
using System.Runtime.Versioning;
namespace System {
public partial class AppDomain
{
internal String GetTargetFrameworkName()
{
return ".NETFramework,Version=v4.5";
}
internal static bool IsAppXModel ()
{
return false;
}
internal static bool IsAppXDesignMode ()
{
return false;
}
}
}

View File

@@ -0,0 +1,7 @@
namespace System
{
static class Array_ReferenceSources
{
internal const int MaxArrayLength = 0X7FEFFFFF;
}
}

View File

@@ -0,0 +1,45 @@
using System.Diagnostics;
namespace System
{
internal enum LogLevel {
Trace = 0,
Status = 20,
Warning= 40,
Error = 50,
Panic = 100,
}
static class BCLDebug
{
[Conditional("_DEBUG")]
static public void Assert(bool condition, string message)
{
}
[Conditional("_DEBUG")]
internal static void Correctness(bool expr, string msg)
{
}
[Conditional("_DEBUG")]
static public void Log (string message)
{
}
[Conditional("_DEBUG")]
static public void Log (string switchName, string message)
{
}
[Conditional("_DEBUG")]
public static void Log (string switchName, LogLevel level, params object[] messages)
{
}
[Conditional("_DEBUG")]
internal static void Perf (bool expr, string msg)
{
}
}
}

View File

@@ -0,0 +1,45 @@
///------------------------------------------------------------------------------
/// <copyright file="CLRConfig.cs" company="Microsoft">
/// Copyright (c) Microsoft Corporation. All rights reserved.
/// </copyright>
///
/// <owner>gpaperin</owner>
///------------------------------------------------------------------------------
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Runtime.InteropServices;
using System.Security;
namespace System {
/// <summary>
/// For now, this class should be the central point to collect all managed declarations
/// of native functions designed to expose config switches.
/// In Dev11 M2.2 we will redesign this class to expose CLRConfig from within the CLR
/// and refactor managed Fx code to access all compat switches through here.
/// </summary>
[FriendAccessAllowed]
internal class CLRConfig {
[FriendAccessAllowed]
[System.Security.SecurityCritical]
[ResourceExposure(ResourceScope.None)]
[SuppressUnmanagedCodeSecurity]
internal static bool CheckLegacyManagedDeflateStream()
{
return false;
}
[System.Security.SecurityCritical]
[ResourceExposure(ResourceScope.None)]
[SuppressUnmanagedCodeSecurity]
internal static bool CheckThrowUnobservedTaskExceptions()
{
return false;
}
} // internal class CLRConfig
} // namespace System
// file CLRConfig

View File

@@ -1,15 +1,10 @@
//
// System.Threading.AutoResetEvent.cs
// CalendarData.cs
//
// Author:
// Dick Porter (dick@ximian.com)
// Veronica De Santis (veron78@interfree.it)
// Authors:
// Marek Safar <marek.safar@gmail.com>
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004, 2005 Novell, Inc (http://www.novell.com)
// Copyright (C) 2015 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
@@ -18,10 +13,10 @@
// 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
@@ -31,19 +26,27 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
namespace System.Threading
namespace System.Globalization
{
[ComVisible (true)]
public sealed class AutoResetEvent : EventWaitHandle
[StructLayout (LayoutKind.Sequential)]
partial class CalendarData
{
// Constructor
public AutoResetEvent (bool initialState)
: base(initialState, EventResetMode.AutoReset)
public static int nativeGetTwoDigitYearMax (int calID)
{
// -1 mean OS does not override default BCL max year
return -1;
}
static bool nativeGetCalendarData (CalendarData data, string localeName, int calendarId)
{
// TODO: Convert calendar-id to mono runtime calendar-id when it's used
return data.fill_calendar_data (localeName.ToLowerInvariant (), calendarId);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
extern bool fill_calendar_data (string localeName, int datetimeIndex);
}
}
}

View File

@@ -1,10 +1,10 @@
//
// INotifyCompletion.cs
// CompatibilitySwitches.cs
//
// Authors:
// Marek Safar <marek.safar@gmail.com>
//
// Copyright (C) 2012 Xamarin, Inc (http://www.xamarin.com)
// Copyright (C) 2015 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
@@ -26,14 +26,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_5
namespace System.Runtime.CompilerServices
namespace System
{
public interface INotifyCompletion
static class CompatibilitySwitches
{
void OnCompleted (Action continuation);
public const bool IsAppEarlierThanSilverlight4 = false;
public const bool IsAppEarlierThanWindowsPhone8 = false;
}
}
#endif
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,123 @@
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Globalization {
using System.Text;
using System.Runtime.Remoting;
using System;
using System.Security;
//
// Data item for EncodingTable. Along with EncodingTable, they are used by
// System.Text.Encoding.
//
// This class stores a pointer to the internal data and the index into that data
// where our required information is found. We load the code page, flags and uiFamilyCodePage
// immediately because they don't require creating an object. Creating any of the string
// names is delayed until somebody actually asks for them and the names are then cached.
[Serializable]
internal class CodePageDataItem
{
internal int m_dataIndex;
internal int m_uiFamilyCodePage;
internal String m_webName;
internal String m_headerName;
internal String m_bodyName;
internal uint m_flags;
[SecurityCritical]
unsafe internal CodePageDataItem(int dataIndex) {
m_dataIndex = dataIndex;
m_uiFamilyCodePage = EncodingTable.codePageDataPtr[dataIndex].uiFamilyCodePage;
m_flags = EncodingTable.codePageDataPtr[dataIndex].flags;
}
static readonly char [] sep = {'|'};
[System.Security.SecurityCritical]
unsafe internal static String CreateString(string pStrings, uint index)
{
if (pStrings[0] == '|') // |str1|str2|str3
{
return pStrings.Split (sep, StringSplitOptions.RemoveEmptyEntries) [index];
/*
int start = 1;
for (int i = 1; true; i ++)
{
sbyte ch = pStrings[i];
if ((ch == '|') || (ch == 0))
{
if (index == 0)
{
return new String(pStrings, start, i - start);
}
index --;
start = i + 1;
if (ch == 0)
{
break;
}
}
}
throw new ArgumentException("pStrings");
*/
}
else
{
return pStrings;
//return new String(pStrings);
}
}
unsafe public String WebName {
[System.Security.SecuritySafeCritical] // auto-generated
get {
if (m_webName==null) {
m_webName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 0);
}
return m_webName;
}
}
public virtual int UIFamilyCodePage {
get {
return m_uiFamilyCodePage;
}
}
unsafe public String HeaderName {
[System.Security.SecuritySafeCritical] // auto-generated
get {
if (m_headerName==null) {
m_headerName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 1);
}
return m_headerName;
}
}
unsafe public String BodyName {
[System.Security.SecuritySafeCritical] // auto-generated
get {
if (m_bodyName==null) {
m_bodyName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 2);
}
return m_bodyName;
}
}
unsafe public uint Flags {
get {
return (m_flags);
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More