cococo111111 / crunch

Automatically exported from code.google.com/p/crunch
Other
0 stars 0 forks source link

Missing includes for compatibility? #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I was using crnlib SVN rev 319 for a game jam project 
https://github.com/David20321/JamForLeelah and ran into some small issues 
compiling a program using crn_decomp.h on Mac OS 10.7.5.

I just had to add some standard library includes: in crn_decomp.h I added 
<string.h> for memset and memcpy, and I used dlmalloc.c to get 
'malloc_usable_size', since it is apparently not part of the Mac malloc.h. In 
crnlib.h I added <stddef.h> to get a definition for NULL. Also as mentioned in 
other issues, __is_pod doesn't work with some compilers, so I just defined it 
to false.

I have attached a patch file with all the changes I made make it work, but 
ideally small parts of the code could be rewritten to not rely on 
malloc_usable_size() or __is_pod(), since they are not reliable across 
platforms and compilers.

Original issue reported on code.google.com by da...@wolfire.com on 25 Feb 2015 at 11:04

Attachments: