12 |
|
|
13 |
|
#include <stdio.h> |
14 |
|
|
15 |
+ |
#ifdef MSDOS |
16 |
+ |
#include <fcntl.h> |
17 |
+ |
#endif |
18 |
+ |
|
19 |
|
#include "color.h" |
20 |
|
|
21 |
|
#include "ambient.h" |
68 |
|
printargs(argc, argv, stdout); |
69 |
|
fputformat(AMBFMT, stdout); |
70 |
|
putchar('\n'); |
71 |
+ |
#ifdef MSDOS |
72 |
+ |
setmode(fileno(stdout), O_BINARY); |
73 |
+ |
#endif |
74 |
|
putambmagic(stdout); |
75 |
|
writamb(fp); |
76 |
|
} else { |
77 |
+ |
#ifdef MSDOS |
78 |
+ |
setmode(fileno(fp), O_BINARY); |
79 |
+ |
#endif |
80 |
|
if (checkheader(fp, AMBFMT, header ? stdout : (FILE *)NULL) < 0) |
81 |
|
goto formaterr; |
82 |
|
if (!hasambmagic(fp)) |