Merge pull request #409 from Alkarex/patch-1
[mono.git] / mcs / class / corlib / System / Console.cs
index 45b721a0c5ab9732d68d004340c523df2ca80388..fe0f229e396b169123983fdb3292b672d18c83d3 100644 (file)
@@ -158,12 +158,21 @@ namespace System
                                stdin = new CStreamReader (OpenStandardInput (0), inputEncoding);
                        } else {
 #endif
+#if FULL_AOT_RUNTIME
+                               Type nslogwriter = Type.GetType ("MonoTouch.Foundation.NSLogWriter, monotouch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");
+                               stdout = (TextWriter) Activator.CreateInstance (nslogwriter);
+#else
                                stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding);
                                ((StreamWriter)stdout).AutoFlush = true;
+#endif
                                stdout = TextWriter.Synchronized (stdout, true);
 
+#if FULL_AOT_RUNTIME
+                               stderr = (TextWriter) Activator.CreateInstance (nslogwriter);
+#else
                                stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding); 
                                ((StreamWriter)stderr).AutoFlush = true;
+#endif
                                stderr = TextWriter.Synchronized (stderr, true);
 
                                stdin = new UnexceptionalStreamReader (OpenStandardInput (0), inputEncoding);