Compiling ImageMagick (libMagick) with CW 8.3

Compiling ImageMagick (libMagick) with CW 8.3

Post by Triska » Wed, 20 Aug 2003 14:39:54


am wondering if anyone out there has had success comipling ImageMagick
5.5.7 using CW 8.3. I have a need to build it under Carbon as I need the
application I am building to run under both OS9 and OS X

I have been successful in comipling:
libjpeg
libzlib
libtif
libpng
but when I try to compile libmagick it gives me a few errors. All the errors
are from the mac.c file, and are below. These are the errors I get when
compiling for OS 9.

Error : function call 'NewQDTextUPP(pascal void (*)(short, char *,
Point,Point))' does not match
'NewQDTextUPP(pascal void (*)(short, const void *, Point, Point))'
mac.c line 234 bottlenecks.textProc=NewQDTextUPP(&TextMethod);

Error : function call 'NewQDRectUPP(pascal void (*)(signed char, Rect *))'
does not match
'NewQDRectUPP(pascal void (*)(signed char, const Rect *))'
mac.c line 236 bottlenecks.rectProc=NewQDRectUPP(&RectMethod);

Error : function call 'NewQDRRectUPP(pascal void (*)(signed char, Rect *,
short, short))' does not match
'NewQDRRectUPP(pascal void (*)(signed char, const Rect *, short, short))'
mac.c line 237 bottlenecks.rRectProc=NewQDRRectUPP(&RRectMethod);

Error : function call 'NewQDOvalUPP(pascal void (*)(signed char, Rect *))'
does not match
'NewQDOvalUPP(pascal void (*)(signed char, const Rect *))'
mac.c line 238 bottlenecks.ovalProc=NewQDOvalUPP(&OvalMethod);

Error : function call 'NewQDArcUPP(pascal void (*)(signed char, Rect *,
short, short))' does not match
'NewQDArcUPP(pascal void (*)(signed char, const Rect *, short, short))'
mac.c line 239 bottlenecks.arcProc=NewQDArcUPP(&ArcMethod);

Error : function call 'NewQDBitsUPP(pascal void (*)(BitMap *, Rect *, Rect
*, short, MacRegion **))' does not match
'NewQDBitsUPP(pascal void (*)(const BitMap *, const Rect *, const Rect *,
short, MacRegion **))'
mac.c line 242 bottlenecks.bitsProc=NewQDBitsUPP(&BitsMethod);


When I compile for Carbon (Adjusting a few settings adding CarbonLib, and
adding MacHeadersCarbon.h to the prefix I get the additional errors


Error : expression syntax error
mac.c line 248 qd.grafProcs=(QDProcs *) &bottlenecks;

Error : illegal use of incomplete struct/union/class 'OpaqueGrafPtr'
mac.c line 251 qd.grafProcs=0L;

Error : function call 'DisposeStdPixUPP({lval} RoutineDescriptor *)' does
not match
'DisposeStdPixUPP(OpaqueStdPixProcPtr *)'
mac.c line 280 DisposeStdPixUPP(bottlenecks.newProc1);

Error : undefined identifier 'c2pstr'
mac.c line 377 c2pstr((char *) name);

Error : undefined identifier 'p2cstr'
mac.c line 471 if (LocaleCompare(p2cstr(p),magick) == 0)

Error : undefined identifier 'c2pstr'
mac.c line 904 c2pstr(strncpy(pathname,path,MaxTextExtent-1));

Error : undefined identifier 'p2cstr'
mac.c line 1018 (void)
strncpy(dir_entry.d_name,p2cstr(search_info.hFileInfo.ioNamePtr),254);

Error : undefined identifier 'c2pstr'
mac.c line 1421 c2pstr((char *) name);

Now from what I have read of Carbon Libraries c2pstr and p2cstr aren't
supported and I should modify the code to use other calls.. not a big deal.
The problem I am struggling with is the errors calling qd.grafProcs.

Anyway I am not really asking you anyone if they can solve the issues with
the code, I don't have a problem working through them, but if someone else
has already done the work.. I would be super interested in getting my hands
on it.

Thanks a lot.

Triskal
 
 
 

Compiling ImageMagick (libMagick) with CW 8.3

Post by Frederick » Wed, 20 Aug 2003 15:36:07


would relaxed pointer types/checks hekp with this lot?

[snip]


As the headers say, in carbon you need to use Get/SetPortGrafProcs

Fred