ExternalStream.st
changeset 18218 80b81f1f725a
parent 17672 758c3ff0c9e0
child 18219 7c6fda11e4b8
child 18312 b414c7a96a1e
--- a/ExternalStream.st	Wed Apr 15 02:31:34 2015 +0200
+++ b/ExternalStream.st	Wed Apr 15 22:33:16 2015 +0200
@@ -6272,14 +6272,28 @@
                 }
 
                 if (extPtr) {
-                    __WRITEBYTES__(cnt, f, extPtr+offs, len, _buffered, __INST(handleType));
+#ifdef WIN32
+                    if ((f == __win32_stdout()) || (f == __win32_stderr())) {
+                        cnt = __win32_fwrite(extPtr+offs, 1, len, f);
+                    } else
+#endif
+                    {
+                        __WRITEBYTES__(cnt, f, extPtr+offs, len, _buffered, __INST(handleType));
+                    }        
                 } else {
                     /*
                      * on interrupt, anObject may be moved to another location.
                      * So we pass anObject, and the offset to the __WRITEBYTES_OBJ__ macro.
                      */
                     offs += nInstBytes;
-                    __WRITEBYTES_OBJ__(cnt, f, anObject, offs, len, _buffered, __INST(handleType));
+#ifdef WIN32
+                    if ((f == __win32_stdout()) || (f == __win32_stderr())) {
+                        cnt = __win32_fwrite((char *)anObject+offs, 1, len, f);
+                    } else
+#endif
+                    {
+                         __WRITEBYTES_OBJ__(cnt, f, anObject, offs, len, _buffered, __INST(handleType));
+                    }        
                 }
 
                 if (cnt >= 0) {
@@ -6454,11 +6468,11 @@
 !ExternalStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.415 2015-03-25 22:28:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.416 2015-04-15 20:33:16 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.415 2015-03-25 22:28:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.416 2015-04-15 20:33:16 stefan Exp $'
 ! !