🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.graphics.algorithms
Article #23

Re: IJG JPEG Engine and Win32

#23
From: Jumpstile Turner
Date: Fri, 05 Jan 1996 12:26
41 lines
2833 bytes
In article <TGL.96Jan3202549@netcom21.netcom.com>, tgl@netcom.com said:
>  * Compiling them with different declarations for "boolean".  The IJG
>    code by default defines boolean = int, but Windows prefers
>    boolean = unsigned char.  Theoretically you should get a compile
>    error if both typedefs are visible in one compilation, but maybe
>    Borland fails to complain about it.
>
>If neither of those explain your problem, you'll have to do some more
>digging, but I'll bet lunch that the problem is of this general ilk.

  Well I think this is my problem.  I don't know how to go about fixing it 
though.  Being as my application is a GUI application I NEED to include the 
windows.h file, so "BOOLEAN" will be defined as an unsigned char, however 
"boolean" is defined in one of the jpeglib includes as int.  If I went through 
all the source and changed "boolean" to "BOOLEAN" would this screw up jpeglib? 
Being as the source uses 0 for FALSE and 1 for TRUE I don't see why this 
shouldn't work.  I'll have to give it a go.

  Incidently as of right now I converted all the stdlib functions into Windows 
API functions (i.e. CreateFile instead of fopen, ReadFile instead of the 
JFREAD macro, HeapAlloc instead of malloc) and everything appears to work 
until I try to allocate a buffer with the jpeglib's memory allocation 
functions.  Then I get an invalid page fault.  This is with using the decoding 
routine from example.c.  I haven't been able to figure out the cause of this 
one.  It will do this even if I use malloc instead of HeapAlloc.  Time for 
more experimentation.

  Oh yes, and lastly, with the borland BCC32 command line compiler, jdmerge.c 
will not compile.  I get an internal backend C1107 error at line 280.  This 
seems like a bug in the borland compiler. It will compile fine if I use 
BCC32A, the alternate compiler. I have to undefine UPSAMPLE_MERGING_SUPPORTED 
so it will skip the contents of jdmerge.c to get it to compile with the 
standard WIN32 compiler.

                -Scott

------------------------------------------------
Jumpstile Turner
fortunat@interpath.com
"Sing the Hare Hare, Dance the Hoochie Koo..."
------------------------------------------------
Technical Details
Message-ID: <4cj5ct$nth@redstone.interpath.net>
Path: arc1-ca.pugleaf.net!redstone.interpath.net!usenet
References: <4cemir$6vb@redstone.interpath.net> <TGL.96Jan3202549@netcom21.netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!redstone.interpath.net!usenet
From: fortunat@interpath.com (Jumpstile Turner)
Newsgroups: comp.graphics.algorithms,comp.lang.c++,comp.os.ms-windows.programmer.graphics,comp.os.ms-windows.programmer.multimedia,comp.os.ms-windows.programmer.win32
Subject: Re: IJG JPEG Engine and Win32
Date: 5 Jan 1996 12:26:05 GMT
Organization: Completely unorganized
Message-ID: <4cj5ct$nth@redstone.interpath.net>
References: <4cemir$6vb@redstone.interpath.net> <TGL.96Jan3202549@netcom21.netcom.com>
NNTP-Posting-Host: fortunat.pdial.interpath.net
X-Newsreader: WinVN 0.99.7