Mercurial > hg > xemacs-beta
diff src/dgif_lib.c @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | de805c49cfc1 |
children |
line wrap: on
line diff
--- a/src/dgif_lib.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/dgif_lib.c Mon Aug 13 11:20:41 2007 +0200 @@ -11,10 +11,23 @@ * 19 Feb 98 - Version 1.2 by Jareth Hein (Support for user specified I/O) * ******************************************************************************/ -#include <config.h> -#include "lisp.h" +#ifdef __MSDOS__ +#include <io.h> +#include <alloc.h> +#include <stdlib.h> +#include <sys\stat.h> +#else +#include <sys/types.h> +#include <sys/stat.h> +#endif /* __MSDOS__ */ -#include "sysfile.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif #include "gifrlib.h" @@ -39,11 +52,11 @@ FILE *f; if ((f = fopen(FileName, -#ifdef WIN32_NATIVE +#ifdef __MSDOS__ "rb" #else "r" -#endif /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ )) == NULL) GifInternError(GifFile, D_GIF_ERR_OPEN_FAILED); @@ -60,13 +73,13 @@ { FILE *f; -#ifdef WIN32_NATIVE +#ifdef __MSDOS__ setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */ f = fdopen(FileHandle, "rb"); /* Make it into a stream: */ setvbuf(f, NULL, _IOFBF, GIF_FILE_BUFFER_SIZE);/* And inc. stream buffer.*/ #else f = fdopen(FileHandle, "r"); /* Make it into a stream: */ -#endif /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ GifStdIOInit(GifFile, f, -1); DGifInitRead(GifFile); @@ -264,11 +277,11 @@ if (!LineLen) LineLen = GifFile->Image.Width; -#if defined(WIN32_NATIVE) || defined(__GNUC__) +#if defined(__MSDOS__) || defined(__GNUC__) if ((Private->PixelCount -= LineLen) > 0xffff0000UL) #else if ((Private->PixelCount -= LineLen) > 0xffff0000) -#endif /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); } @@ -297,11 +310,11 @@ GifInternError(GifFile, D_GIF_ERR_NOT_READABLE); } -#if defined(WIN32_NATIVE) || defined(__GNUC__) +#if defined(__MSDOS__) || defined(__GNUC__) if (--Private->PixelCount > 0xffff0000UL) #else if (--Private->PixelCount > 0xffff0000) -#endif /* WIN32_NATIVE */ +#endif /* __MSDOS__ */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); }