changeset 15008:aca392dc5b0f

[DJGPP v2]: Include io.h. (main) [DJGPP v2]: Switch standard streams to binary with setmode.
author Richard M. Stallman <rms@gnu.org>
date Fri, 12 Apr 1996 16:02:38 +0000
parents 5baafbcd9dc2
children ea6167033080
files lib-src/hexl.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/hexl.c	Fri Apr 12 15:44:42 1996 +0000
+++ b/lib-src/hexl.c	Fri Apr 12 16:02:38 1996 +0000
@@ -2,6 +2,9 @@
 #include <ctype.h>
 #ifdef MSDOS
 #include <fcntl.h>
+#if __DJGPP__ >= 2
+#include <io.h>
+#endif
 #endif
 
 #define DEFAULT_GROUPING	0x01
@@ -134,9 +137,13 @@
 	  char buf[18];
 
 #ifdef MSDOS
+#if __DJGPP__ >= 2
+	  setmode (fileno (stdout), O_BINARY);
+#else
 	  (stdout)->_flag &= ~_IOTEXT; /* print binary */
 	  _setmode (fileno (stdout), O_BINARY);
 #endif
+#endif
 	  for (;;)
 	    {
 	      register int i, c, d;
@@ -178,9 +185,13 @@
       else
 	{
 #ifdef MSDOS
+#if __DJGPP__ >= 2
+	  setmode (fileno (stdout), O_BINARY);
+#else
 	  (fp)->_flag &= ~_IOTEXT; /* read binary */
 	  _setmode (fileno (fp), O_BINARY);
 #endif
+#endif
 	  address = 0;
 	  string[0] = ' ';
 	  string[17] = '\0';