From a8ada67af5580c0012da24e40f072f80a877825b Mon Sep 17 00:00:00 2001 From: Thierry Leconte Date: Mon, 9 Feb 2004 22:09:13 +0000 Subject: [PATCH] add WIN32 ifdef --- main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.c b/main.c index 124315a..003556f 100644 --- a/main.c +++ b/main.c @@ -116,7 +116,11 @@ ImageOut (char *filename, char *chid, float **prow, int nrow, int depth, printf ("Writing %s ... ", filename); fflush (stdout); +#ifdef WIN32 + pngfile = fopen (filename, "wb"); +#else pngfile = fopen (filename, "w"); +#endif if (pngfile == NULL) { fprintf (stderr, "could not open %s\n", filename); return (1); @@ -138,10 +142,12 @@ ImageOut (char *filename, char *chid, float **prow, int nrow, int depth, case 8: pixel[i] = floor (pv); break; +#ifndef WIN32 case 16: ((unsigned short *) pixel)[i] = htons ((unsigned short) floor (pv * 255.0)); break; +#endif } } png_write_row (png_ptr, pixel); @@ -196,7 +202,11 @@ ImageColorOut (char *filename, float **prow, int nrow) printf ("Computing False colors & writing : %s ...", filename); fflush (stdout); +#ifdef WIN32 + pngfile = fopen (filename, "wb"); +#else pngfile = fopen (filename, "w"); +#endif if (pngfile == NULL) { fprintf (stderr, "could not open %s\n", filename); return (1);