unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* jpeg problem for NT Emacs
@ 2004-11-15 15:25 Plamen Todorov
  0 siblings, 0 replies; only message in thread
From: Plamen Todorov @ 2004-11-15 15:25 UTC (permalink / raw)


Hello,
I had a problem compiling JPEG support for NT emacs 21.3.50. After trying to
load a JPEG image I could see the following message: 
 "JPEG parameter struct mismatch: library thinks size is 432, caller expects 464", 
which is reported by jdapimin.c module of the JPEG library (version 6b-3).

image.c includes jpeglib.h. It includes jcontrol.h, which:
#ifdef __WIN32__
#include <windows.h>
/* Define "boolean" as unsigned char, not int, per Windows custom */
//#ifndef __RPCNDR_H__     /* don't conflict if rpcndr.h already read */
#ifndef boolean     /* don't conflict if rpcndr.h already read */
typedef unsigned char boolean;
#endif

Then, in jmorecfg.h: 
#ifndef HAVE_BOOLEAN 
typedef int boolean;
#endif

Since the define __WIN32__ is not by default set for windows compilation, the
JPEG related structures of image.c are compiled with typedef int boolean. Then
in image.c, fn_jpeg_CreateDecompress(...) call, the sizeof(cinfo)  computes
different size (464) than the one jpeg62.dll expects (432). 

By passing -D__WIN32__ to cflags of configure.bat, everything is ok - the compiled emacs can open JPEG files.  

Shouldn't this #define be set by default in nmake.defs ?

Plamen

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-15 15:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-15 15:25 jpeg problem for NT Emacs Plamen Todorov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).