6 |
|
*/ |
7 |
|
|
8 |
|
#include <stdio.h> |
9 |
– |
|
10 |
– |
#ifdef MSDOS |
11 |
– |
#include <fcntl.h> |
12 |
– |
#endif |
13 |
– |
|
9 |
|
#include <math.h> |
15 |
– |
|
10 |
|
#include <ctype.h> |
17 |
– |
|
11 |
|
#include <time.h> |
12 |
|
|
13 |
+ |
#include "platform.h" |
14 |
|
#include "color.h" |
21 |
– |
|
15 |
|
#include "resolu.h" |
16 |
|
|
17 |
|
|
94 |
|
if (read(fileno(stdin), inpbuf, 2) != 2 || inpbuf[0] != 'P') |
95 |
|
quiterr("input not a Poskanzer Pixmap"); |
96 |
|
ptype = inpbuf[1]; |
97 |
< |
#ifdef MSDOS |
97 |
> |
#ifdef _WIN32 |
98 |
|
if (ptype > 4) |
99 |
< |
setmode(fileno(stdin), O_BINARY); |
100 |
< |
setmode(fileno(stdout), O_BINARY); |
99 |
> |
SET_FILE_BINARY(stdin); |
100 |
> |
SET_FILE_BINARY(stdout); |
101 |
|
#endif |
102 |
|
xmax = scanint(stdin); |
103 |
|
ymax = scanint(stdin); |
144 |
|
quiterr("unsupported Pixmap type"); |
145 |
|
} |
146 |
|
} else { |
147 |
< |
#ifdef MSDOS |
148 |
< |
setmode(fileno(stdin), O_BINARY); |
147 |
> |
#ifdef _WIN32 |
148 |
> |
SET_FILE_BINARY(stdin); |
149 |
|
if (binflag) |
150 |
< |
setmode(fileno(stdout), O_BINARY); |
150 |
> |
SET_FILE_BINARY(stdout); |
151 |
|
#endif |
152 |
|
/* get header info. */ |
153 |
|
if (checkheader(stdin, COLRFMT, NULL) < 0 || |