So I was just brushing around through old source code on my comp and I re-discovered kplib.c, Ken Silverman's marvellous all-in-one image library. It compiled under gcc, but produced segmentation errors during runtime.
My machine: Intel Core 2 duo My OS: ubuntu 9.10 gcc: version 4.4.1
EDIT: I realized that kplib wasn't written with x86_64 in mind, thus all the places where variables are declared as longs where they should in fact be ints. That is probably the source of the problem. Will a more modern version of kplib ever be released?
Edited by AcetoliNe at
TX at
Re: kplib in 64-bit gcc?
There's one in EDuke32 svn... http://eduke32.svn.sf.net/viewvc/eduke32/polymer/eduke32/build/src/kplib.c
Port is based on one of the later versions of kplib.c from 2008 or 2009, snagged it from poly2vox I think. There should be very few changes made that have tied it to Build any more than the regular version... you'll just need to replace kpzload() with the original version (modified it to use Build file loading functions) and swap the calls to Bmalloc() and Bfree() et al for their regular counterparts (EDuke32 replaces malloc/calloc/realloc/free and friends with a different allocator).
AcetoliNe at
Yup, that worked! Thanks. I also had to include <stdint.h>, in case anyone wants to duplicate what I'm doing.
TX at
Oh, right. That's included from the compat.h include you probably had to remove at the same time.