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

@ -125,11 +125,11 @@ namespace System
// UTF-8 ZWNBSP (zero-width non-breaking space).
//
int code_page = 0;
Encoding.InternalCodePage (ref code_page);
EncodingHelper.InternalCodePage (ref code_page);
if (code_page != -1 && ((code_page & 0x0fffffff) == 3 // UTF8Encoding.UTF8_CODE_PAGE
|| ((code_page & 0x10000000) != 0)))
inputEncoding = outputEncoding = Encoding.UTF8Unmarked;
inputEncoding = outputEncoding = EncodingHelper.UTF8Unmarked;
else
inputEncoding = outputEncoding = Encoding.Default;
}
@ -141,13 +141,13 @@ namespace System
{
#if !NET_2_1
if (!Environment.IsRunningOnWindows && ConsoleDriver.IsConsole) {
StreamWriter w = new CStreamWriter (OpenStandardOutput (0), outputEncoding);
StreamWriter w = new CStreamWriter (OpenStandardOutput (0), outputEncoding, true);
w.AutoFlush = true;
stdout = TextWriter.Synchronized (w, true);
stdout = TextWriter.Synchronized (w);
w = new CStreamWriter (OpenStandardOutput (0), outputEncoding);
w = new CStreamWriter (OpenStandardOutput (0), outputEncoding, true);
w.AutoFlush = true;
stderr = TextWriter.Synchronized (w, true);
stderr = TextWriter.Synchronized (w);
stdin = new CStreamReader (OpenStandardInput (0), inputEncoding);
} else {
@ -161,7 +161,7 @@ namespace System
stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding);
((StreamWriter)stdout).AutoFlush = true;
#endif
stdout = TextWriter.Synchronized (stdout, true);
stdout = TextWriter.Synchronized (stdout);
#if MONOTOUCH && FULL_AOT_RUNTIME
stderr = new NSLogWriter ();
@ -169,7 +169,7 @@ namespace System
stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding);
((StreamWriter)stderr).AutoFlush = true;
#endif
stderr = TextWriter.Synchronized (stderr, true);
stderr = TextWriter.Synchronized (stderr);
stdin = new UnexceptionalStreamReader (OpenStandardInput (0), inputEncoding);
stdin = TextReader.Synchronized (stdin);
@ -212,7 +212,7 @@ namespace System
try {
return new FileStream (handle, access, false, bufferSize, false, bufferSize == 0);
} catch (IOException) {
return new NullStream ();
return Stream.Null;
}
}
@ -661,7 +661,6 @@ namespace System
set { ConsoleDriver.WindowWidth = value; }
}
#if NET_4_5
public static bool IsErrorRedirected {
get {
return ConsoleDriver.IsErrorRedirected;
@ -679,7 +678,6 @@ namespace System
return ConsoleDriver.IsInputRedirected;
}
}
#endif
public static void Beep ()
{