abarbu / scheme2c-compatibility

Chicken egg that makes it more compatible with Scheme->C
3 stars 3 forks source link

Breakage under FreeBSD due to deprecated header file and implicit declaration of XLookupString #1

Closed sjamaan closed 10 years ago

sjamaan commented 10 years ago

Hello Andrei,

I've set up a Salmonella instance under FreeBSD and am now looking through the failing eggs and contacting their maintainers.

The scheme2c-compatibility egg is breaking due to the use of , which is a deprecated nonstandard header file. On FreeBSD, this leads to a compilation error. See the salmonella report to see this in action.

This is easily fixed simply by removing that include line from dither.c, because you're already including , which is where malloc() lives in standard C. If it's needed for broken platforms, you can always conditionally include it.

There's also a message about an implicit declaration of XLookupString; this can be resolved easily by adding (foreign-declare "#include <X11/Xutil.h>") to scheme2c-compatibility.scm. However, after doing so I get yet another warning, which happens because you're using the "blob" foreign type, which is an unsigned char * if I'm not mistaken. This can be fixed by changing blob to scheme-pointer. However, you'd have to check the type manually to ensure that it's a blob.

I hope you'll be able to find the time to fix these things. It would really improve the quality of CHICKEN cross-platform! Also, don't forget to tag a new release after fixing these small things :)

Thanks! Peter Bex

abarbu commented 10 years ago

Hi Peter,

I checked in the change for malloc.h and Xutil.h. This should fix everything but the blob warning. That one should be innocuous, the other two could cause bugs. Using blobs is easier in this case because they can be converted to strings easily.

Thanks for reporting this!

Andrei