Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -1000,11 +1000,17 @@ namespace System {
}
#if MONO_FEATURE_MULTIPLE_APPDOMAINS
#if MONODROID
[Obsolete ("AppDomain.CreateDomain will no longer be supported in .NET 5 and later. Consider AssemblyLoadContext when it becomes available https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/understanding-assemblyloadcontext")]
#endif
public static AppDomain CreateDomain (string friendlyName)
{
return CreateDomain (friendlyName, null, null);
}
#if MONODROID
[Obsolete ("AppDomain.CreateDomain will no longer be supported in .NET 5 and later. Consider AssemblyLoadContext when it becomes available https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/understanding-assemblyloadcontext")]
#endif
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo)
{
return CreateDomain (friendlyName, securityInfo, null);
@@ -1015,6 +1021,9 @@ namespace System {
[MonoLimitationAttribute ("Currently it does not allow the setup in the other domain")]
[SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
#if MONODROID
[Obsolete ("AppDomain.CreateDomain will no longer be supported in .NET 5 and later. Consider AssemblyLoadContext when it becomes available https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/understanding-assemblyloadcontext")]
#endif
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info)
{
if (friendlyName == null)

View File

@@ -110,6 +110,7 @@ namespace System
int length = this.Length;
for (int i = 0; i < length; i++) {
T value;
// Do not change this to call GetGenericValue_icall directly, due to special casing in the runtime.
GetGenericValueImpl (i, out value);
if (item == null){
if (value == null) {
@@ -138,6 +139,7 @@ namespace System
throw new ArgumentOutOfRangeException ("index");
T value;
// Do not change this to call GetGenericValue_icall directly, due to special casing in the runtime.
GetGenericValueImpl (index, out value);
return value;
}
@@ -165,6 +167,7 @@ namespace System
int length = this.Length;
for (int i = 0; i < length; i++) {
T value;
// Do not change this to call GetGenericValue_icall directly, due to special casing in the runtime.
GetGenericValueImpl (i, out value);
if (item == null){
if (value == null)
@@ -190,6 +193,7 @@ namespace System
throw new ArgumentOutOfRangeException ("index");
T value;
// Do not change this to call GetGenericValue_icall directly, due to special casing in the runtime.
GetGenericValueImpl (index, out value);
return value;
}
@@ -204,16 +208,31 @@ namespace System
oarray [index] = (object)item;
return;
}
// Do not change this to call SetGenericValue_icall directly, due to special casing in the runtime.
SetGenericValueImpl (index, ref item);
}
// CAUTION! No bounds checking!
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern void GetGenericValueImpl<T> (int pos, out T value);
extern static void GetGenericValue_icall<T> (ref Array self, int pos, out T value);
// CAUTION! No bounds checking!
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern void SetGenericValueImpl<T> (int pos, ref T value);
extern static void SetGenericValue_icall<T> (ref Array self, int pos, ref T value);
// This is a special case in the runtime.
internal void GetGenericValueImpl<T> (int pos, out T value)
{
var self = this;
GetGenericValue_icall (ref self, pos, out value);
}
// This is a special case in the runtime.
internal void SetGenericValueImpl<T> (int pos, ref T value)
{
var self = this;
SetGenericValue_icall (ref self, pos, ref value);
}
internal struct InternalEnumerator<T> : IEnumerator<T>
{

View File

@@ -195,76 +195,81 @@ namespace System {
lock (initLock){
if (inited)
return;
inited = true;
/* This should not happen any more, since it is checked for in Console */
if (!ConsoleDriver.IsConsole)
throw new IOException ("Not a tty.");
ConsoleDriver.SetEcho (false);
string endString = null;
keypadXmit = reader.Get (TermInfoStrings.KeypadXmit);
keypadLocal = reader.Get (TermInfoStrings.KeypadLocal);
if (keypadXmit != null) {
WriteConsole (keypadXmit); // Needed to get the arrows working
if (keypadLocal != null)
endString += keypadLocal;
}
origPair = reader.Get (TermInfoStrings.OrigPair);
origColors = reader.Get (TermInfoStrings.OrigColors);
setfgcolor = reader.Get (TermInfoStrings.SetAForeground);
setbgcolor = reader.Get (TermInfoStrings.SetABackground);
maxColors = reader.Get (TermInfoNumbers.MaxColors);
maxColors = Math.Max (Math.Min (maxColors, 16), 1);
string resetColors = (origColors == null) ? origPair : origColors;
if (resetColors != null)
endString += resetColors;
unsafe {
if (!ConsoleDriver.TtySetup (keypadXmit, endString, out control_characters, out native_terminal_size)){
control_characters = new byte [17];
native_terminal_size = null;
//throw new IOException ("Error initializing terminal.");
try {
/* This should not happen any more, since it is checked for in Console */
if (!ConsoleDriver.IsConsole)
throw new IOException ("Not a tty.");
ConsoleDriver.SetEcho (false);
string endString = null;
keypadXmit = reader.Get (TermInfoStrings.KeypadXmit);
keypadLocal = reader.Get (TermInfoStrings.KeypadLocal);
if (keypadXmit != null) {
WriteConsole (keypadXmit); // Needed to get the arrows working
if (keypadLocal != null)
endString += keypadLocal;
}
origPair = reader.Get (TermInfoStrings.OrigPair);
origColors = reader.Get (TermInfoStrings.OrigColors);
setfgcolor = reader.Get (TermInfoStrings.SetAForeground);
setbgcolor = reader.Get (TermInfoStrings.SetABackground);
maxColors = reader.Get (TermInfoNumbers.MaxColors);
maxColors = Math.Max (Math.Min (maxColors, 16), 1);
string resetColors = (origColors == null) ? origPair : origColors;
if (resetColors != null)
endString += resetColors;
unsafe {
if (!ConsoleDriver.TtySetup (keypadXmit, endString, out control_characters, out native_terminal_size)){
control_characters = new byte [17];
native_terminal_size = null;
//throw new IOException ("Error initializing terminal.");
}
}
stdin = new StreamReader (Console.OpenStandardInput (0), Console.InputEncoding);
clear = reader.Get (TermInfoStrings.ClearScreen);
bell = reader.Get (TermInfoStrings.Bell);
if (clear == null) {
clear = reader.Get (TermInfoStrings.CursorHome);
clear += reader.Get (TermInfoStrings.ClrEos);
}
csrVisible = reader.Get (TermInfoStrings.CursorNormal);
if (csrVisible == null)
csrVisible = reader.Get (TermInfoStrings.CursorVisible);
csrInvisible = reader.Get (TermInfoStrings.CursorInvisible);
if (term == "cygwin" || term == "linux" || (term != null && term.StartsWith ("xterm")) ||
term == "rxvt" || term == "dtterm") {
titleFormat = "\x1b]0;{0}\x7"; // icon + window title
} else if (term == "iris-ansi") {
titleFormat = "\x1bP1.y{0}\x1b\\"; // not tested
} else if (term == "sun-cmd") {
titleFormat = "\x1b]l{0}\x1b\\"; // not tested
}
cursorAddress = reader.Get (TermInfoStrings.CursorAddress);
GetCursorPosition ();
#if DEBUG
logger.WriteLine ("noGetPosition: {0} left: {1} top: {2}", noGetPosition, cursorLeft, cursorTop);
logger.Flush ();
#endif
if (noGetPosition) {
WriteConsole (clear);
cursorLeft = 0;
cursorTop = 0;
}
} finally {
inited = true;
}
stdin = new StreamReader (Console.OpenStandardInput (0), Console.InputEncoding);
clear = reader.Get (TermInfoStrings.ClearScreen);
bell = reader.Get (TermInfoStrings.Bell);
if (clear == null) {
clear = reader.Get (TermInfoStrings.CursorHome);
clear += reader.Get (TermInfoStrings.ClrEos);
}
csrVisible = reader.Get (TermInfoStrings.CursorNormal);
if (csrVisible == null)
csrVisible = reader.Get (TermInfoStrings.CursorVisible);
csrInvisible = reader.Get (TermInfoStrings.CursorInvisible);
if (term == "cygwin" || term == "linux" || (term != null && term.StartsWith ("xterm")) ||
term == "rxvt" || term == "dtterm") {
titleFormat = "\x1b]0;{0}\x7"; // icon + window title
} else if (term == "iris-ansi") {
titleFormat = "\x1bP1.y{0}\x1b\\"; // not tested
} else if (term == "sun-cmd") {
titleFormat = "\x1b]l{0}\x1b\\"; // not tested
}
cursorAddress = reader.Get (TermInfoStrings.CursorAddress);
GetCursorPosition ();
#if DEBUG
logger.WriteLine ("noGetPosition: {0} left: {1} top: {2}", noGetPosition, cursorLeft, cursorTop);
logger.Flush ();
#endif
if (noGetPosition) {
WriteConsole (clear);
cursorLeft = 0;
cursorTop = 0;
}
}
}

View File

@@ -73,11 +73,11 @@ namespace System {
}
[DllImport ("__Internal")]
extern static IntPtr xamarin_timezone_get_names (ref int count);
extern static IntPtr xamarin_timezone_get_names (ref uint count);
static ReadOnlyCollection<string> GetMonoTouchNames ()
{
int count = 0;
uint count = 0;
IntPtr array = xamarin_timezone_get_names (ref count);
string [] names = new string [count];
for (int i = 0, offset = 0; i < count; i++, offset += IntPtr.Size) {
@@ -90,11 +90,11 @@ namespace System {
}
[DllImport ("__Internal")]
extern static IntPtr xamarin_timezone_get_data (string name, ref int size);
extern static IntPtr xamarin_timezone_get_data (string name, ref uint size);
static Stream GetMonoTouchData (string name, bool throw_on_error = true)
{
int size = 0;
uint size = 0;
IntPtr data = xamarin_timezone_get_data (name, ref size);
if (size <= 0) {
if (throw_on_error)