Re: How to know if malloc.h is available?
- From: Lew Pitcher <lpitcher@xxxxxxxxxxxx>
- Date: Wed, 19 Nov 2008 16:17:00 -0500
On November 19, 2008 16:10, in comp.unix.programmer, Lew Pitcher
(lpitcher@xxxxxxxxxxxx) wrote:
On November 19, 2008 15:40, in comp.unix.programmer, fogli_beppe@xxxxxxxxx
(fogli_beppe@xxxxxxxxx) wrote:
Hi,[snip]
is there a way to know if the header file malloc.h is available?
I have this piece of code:
#if defined (__sun) || defined (__i386) || defined (__ia64)
#include <malloc.h>
#define HAVE_MALLINFO
#endif
It compiles on linux (x86, x86_64 and itanium) and on Solaris (SPARC)
but it doesn't compile on Mac OS X (x86), where the compiler (gcc from
XCode 3.1.1) can't find malloc.h .
Well, that's the cannonical test for whether or not malloc.h is available
to the compiler.
Now, two things:
1) For the compiler to be /complete/, it /must/ include a malloc.h header.
So, go back and check the install for the compiler to see if it missed
something.
Oops... let me correct that.
For the compiler to be complete, it must include malloc() and friends. The
header for the malloc() family of functions is <stdlib.h>, not <malloc.h>.
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
.
- Follow-Ups:
- Re: How to know if malloc.h is available?
- From: Doug McIntyre
- Re: How to know if malloc.h is available?
- References:
- How to know if malloc.h is available?
- From: fogli_beppe
- Re: How to know if malloc.h is available?
- From: Lew Pitcher
- How to know if malloc.h is available?
- Prev by Date: replacing read with mmap
- Next by Date: Re: replacing read with mmap
- Previous by thread: Re: How to know if malloc.h is available?
- Next by thread: Re: How to know if malloc.h is available?
- Index(es):
Relevant Pages
|