diff options
| author | Richard M. Stallman | 1996-04-12 16:02:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-04-12 16:02:38 +0000 |
| commit | 659d3b439c911daaf4af01c63ba09863b800c8ca (patch) | |
| tree | a730b17b74dfb13572ead31f5b17dc797a301498 /lib-src/hexl.c | |
| parent | b696f8606b13abfaa1b4d75bebf773ff572a5d6c (diff) | |
| download | emacs-659d3b439c911daaf4af01c63ba09863b800c8ca.tar.gz emacs-659d3b439c911daaf4af01c63ba09863b800c8ca.zip | |
[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.c | 11 |
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 @@ | |||
| 2 | #include <ctype.h> | 2 | #include <ctype.h> |
| 3 | #ifdef MSDOS | 3 | #ifdef MSDOS |
| 4 | #include <fcntl.h> | 4 | #include <fcntl.h> |
| 5 | #if __DJGPP__ >= 2 | ||
| 6 | #include <io.h> | ||
| 7 | #endif | ||
| 5 | #endif | 8 | #endif |
| 6 | 9 | ||
| 7 | #define DEFAULT_GROUPING 0x01 | 10 | #define DEFAULT_GROUPING 0x01 |
| @@ -134,9 +137,13 @@ main (argc, argv) | |||
| 134 | char buf[18]; | 137 | char buf[18]; |
| 135 | 138 | ||
| 136 | #ifdef MSDOS | 139 | #ifdef MSDOS |
| 140 | #if __DJGPP__ >= 2 | ||
| 141 | setmode (fileno (stdout), O_BINARY); | ||
| 142 | #else | ||
| 137 | (stdout)->_flag &= ~_IOTEXT; /* print binary */ | 143 | (stdout)->_flag &= ~_IOTEXT; /* print binary */ |
| 138 | _setmode (fileno (stdout), O_BINARY); | 144 | _setmode (fileno (stdout), O_BINARY); |
| 139 | #endif | 145 | #endif |
| 146 | #endif | ||
| 140 | for (;;) | 147 | for (;;) |
| 141 | { | 148 | { |
| 142 | register int i, c, d; | 149 | register int i, c, d; |
| @@ -178,9 +185,13 @@ main (argc, argv) | |||
| 178 | else | 185 | else |
| 179 | { | 186 | { |
| 180 | #ifdef MSDOS | 187 | #ifdef MSDOS |
| 188 | #if __DJGPP__ >= 2 | ||
| 189 | setmode (fileno (stdout), O_BINARY); | ||
| 190 | #else | ||
| 181 | (fp)->_flag &= ~_IOTEXT; /* read binary */ | 191 | (fp)->_flag &= ~_IOTEXT; /* read binary */ |
| 182 | _setmode (fileno (fp), O_BINARY); | 192 | _setmode (fileno (fp), O_BINARY); |
| 183 | #endif | 193 | #endif |
| 194 | #endif | ||
| 184 | address = 0; | 195 | address = 0; |
| 185 | string[0] = ' '; | 196 | string[0] = ' '; |
| 186 | string[17] = '\0'; | 197 | string[17] = '\0'; |