ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/ra_ppm.c
(Generate patch)

Comparing ray/src/px/ra_ppm.c (file contents):
Revision 2.9 by greg, Sat Feb 22 02:07:28 2003 UTC vs.
Revision 2.10 by schorsch, Thu Jun 5 19:29:34 2003 UTC

# Line 6 | Line 6 | static const char      RCSid[] = "$Id$";
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  
# Line 101 | Line 94 | char  *argv[];
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);
# Line 151 | Line 144 | char  *argv[];
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 ||

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines