summaryrefslogtreecommitdiff
path: root/lib-src/hexl.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-04-12 16:02:38 +0000
committerRichard M. Stallman <rms@gnu.org>1996-04-12 16:02:38 +0000
commit659d3b439c911daaf4af01c63ba09863b800c8ca (patch)
treea730b17b74dfb13572ead31f5b17dc797a301498 /lib-src/hexl.c
parentb696f8606b13abfaa1b4d75bebf773ff572a5d6c (diff)
downloademacs-659d3b439c911daaf4af01c63ba09863b800c8ca.tar.gz
[DJGPP v2]: Include io.h.
(main) [DJGPP v2]: Switch standard streams to binary with setmode.
Diffstat (limited to 'lib-src/hexl.c')
-rw-r--r--lib-src/hexl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index b090dae335b..417d9f285d1 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -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 @@ main (argc, argv)
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 @@ main (argc, argv)
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';