diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-10-12 08:37:25 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-10-12 08:37:25 +0200 |
commit | 4ee01bbc747ce85b5ccfeed3e934dfb76fb14482 (patch) | |
tree | cde2ab7ff286056127ca4d7929ece9dc0b0216ca /filter | |
parent | 358811630686460d6b0a96021a1bcb4c3124fb03 (diff) | |
download | mupdf-4ee01bbc747ce85b5ccfeed3e934dfb76fb14482.tar.xz |
merged seokgyos win32 fixes
Diffstat (limited to 'filter')
-rw-r--r-- | filter/filec.c | 6 | ||||
-rw-r--r-- | filter/filer.c | 8 | ||||
-rw-r--r-- | filter/jbig2d.c | 14 |
3 files changed, 21 insertions, 7 deletions
diff --git a/filter/filec.c b/filter/filec.c index 0c4d034a..34db4d12 100644 --- a/filter/filec.c +++ b/filter/filec.c @@ -21,11 +21,11 @@ fz_openfile(fz_file **filep, char *path, int mode) realmode = 0; if (mode == FZ_READ) - realmode = O_RDONLY; + realmode = O_BINARY | O_RDONLY; if (mode == FZ_WRITE) - realmode = O_WRONLY | O_CREAT | O_TRUNC; + realmode = O_BINARY | O_WRONLY | O_CREAT | O_TRUNC; if (mode == FZ_APPEND) - realmode = O_WRONLY; + realmode = O_BINARY | O_WRONLY; fd = open(path, realmode, 0644); if (fd == -1) diff --git a/filter/filer.c b/filter/filer.c index ead97bdc..29e04558 100644 --- a/filter/filer.c +++ b/filter/filer.c @@ -11,7 +11,7 @@ static int doread(fz_buffer *b, int fd) return n; } -static int producedata(fz_file *f) +int fz_producedata(fz_file *f) { fz_error *reason; int produced; @@ -99,7 +99,7 @@ fz_peekbyte(fz_file *f) if (f->out->rp == f->out->wp) { if (f->out->eof) return EOF; - if (producedata(f)) return EOF; + if (fz_producedata(f)) return EOF; } if (f->out->rp < f->out->wp) @@ -114,7 +114,7 @@ fz_readbyte(fz_file *f) if (f->out->rp == f->out->wp) { if (f->out->eof) return EOF; - if (producedata(f)) return EOF; + if (fz_producedata(f)) return EOF; } if (f->out->rp < f->out->wp) @@ -136,7 +136,7 @@ fz_read(fz_file *f, char *buf, int n) if (f->out->rp == f->out->wp) { if (f->out->eof) return i; - if (producedata(f) < 0) return -1; + if (fz_producedata(f) < 0) return -1; } } diff --git a/filter/jbig2d.c b/filter/jbig2d.c index e58a5e49..3d191e65 100644 --- a/filter/jbig2d.c +++ b/filter/jbig2d.c @@ -12,7 +12,21 @@ +create the per-page ctx */ +#ifdef WIN32 /* Microsoft Visual C+*/ + +typedef signed char int8_t; +typedef short int int16_t; +typedef int int32_t; +typedef __int64 int64_t; + +typedef unsigned char uint8_t; +typedef unsigned short int uint16_t; +typedef unsigned int uint32_t; + +#else #include <inttypes.h> +#endif + #include <jbig2.h> typedef struct fz_jbig2d_s fz_jbig2d; |