malloc.h
make
may fail in compiling some types of Unix
software if it cannot find malloc.h. Software
designed for older Unix systems may expect to find this header file
in /usr/include; however,
malloc.h is not present in this directory. The
set of malloc( ) function prototypes is actually
found in stdlib.h. For portability, your
programs should include stdlib.h instead of
malloc.h. (This is the norm; systems that
require you to use malloc.h are the rare
exception these days.) GNU autoconf will detect
systems that require malloc.h and define the
HAVE_MALLOC_H macro. If you do not use GNU
autoconf, you will need to detect this case on
your own and set the macro accordingly. You can handle such cases
with this code:
#include <stdlib.h> #ifdef HAVE_MALLOC_H #include <malloc.h> #endif
For a list of libraries that come with Mac OS X, see Section 5.7, later in this chapter.