#4 malloc.h error fix in FreeBSD and iPhone

open-fixed
nobody
None
5
2009-08-27
2009-08-26
sam foster
No

When compiling the latest Megahal source in the latest FreeBSD or for the iPhone SDK, you get this error:

[cm@hecate ~/src/megahal-9.1.1]$ make
gcc -g -Wall -c main.c
In file included from main.c:7:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by <stdlib.h>"
*** Error code 1
Stop in /usr/home/cm/src/megahal-9.1.1.

I've made a patch to change various cases of

#if !defined(AMIGA) && !defined(__mac_os)
#include <malloc.h>
#endif

to:

#if !defined(AMIGA) && !defined(__mac_os) && !defined(__APPLE__) && !defined(__FreeBSD__)
#include <malloc.h>
#endif

This appears to resolve it.

Discussion

  • sam foster
    sam foster
    2009-08-26

    Adds if !defined checks for Apple and FreeBSD to decide whether or not to include malloc.h

     
  • sam foster
    sam foster
    2009-08-27

    • status: open --> open-fixed