Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -136,45 +136,29 @@ namespace System
{
#if !NET_2_1
if (!Environment.IsRunningOnWindows && ConsoleDriver.IsConsole) {
StreamWriter w = new CStreamWriter (OpenStandardOutput (0), outputEncoding, true);
w.AutoFlush = true;
stdout = TextWriter.Synchronized (w);
w = new CStreamWriter (OpenStandardOutput (0), outputEncoding, true);
w.AutoFlush = true;
stderr = TextWriter.Synchronized (w);
stdin = new CStreamReader (OpenStandardInput (0), inputEncoding);
} else {
stdout = TextWriter.Synchronized (new CStreamWriter (OpenStandardOutput (0), outputEncoding, true) { AutoFlush = true });
stderr = TextWriter.Synchronized (new CStreamWriter (OpenStandardError (0), outputEncoding, true) { AutoFlush = true });
} else
#endif
{
stdin = TextReader.Synchronized (new UnexceptionalStreamReader (OpenStandardInput (0), inputEncoding));
#if MONOTOUCH
stdout = new NSLogWriter ();
#else
stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding);
((StreamWriter)stdout).AutoFlush = true;
#endif
stdout = TextWriter.Synchronized (stdout);
#if MONOTOUCH
stderr = new NSLogWriter ();
#else
stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding);
((StreamWriter)stderr).AutoFlush = true;
#endif
stderr = TextWriter.Synchronized (stderr);
stdin = new UnexceptionalStreamReader (OpenStandardInput (0), inputEncoding);
stdin = TextReader.Synchronized (stdin);
#if !NET_2_1
}
#endif
stdout = TextWriter.Synchronized (new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding) { AutoFlush = true });
stderr = TextWriter.Synchronized (new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding) { AutoFlush = true });
#if MONODROID
if (LogcatTextWriter.IsRunningOnAndroid ()) {
stdout = TextWriter.Synchronized (new LogcatTextWriter ("mono-stdout", stdout));
stderr = TextWriter.Synchronized (new LogcatTextWriter ("mono-stderr", stderr));
if (LogcatTextWriter.IsRunningOnAndroid ()) {
stdout = TextWriter.Synchronized (new LogcatTextWriter ("mono-stdout", stdout));
stderr = TextWriter.Synchronized (new LogcatTextWriter ("mono-stderr", stderr));
}
#endif // MONODROID
#endif // MONOTOUCH
}
#endif // MONODROID
GC.SuppressFinalize (stdout);
GC.SuppressFinalize (stderr);