axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] -I/usr/include/sys on MacOS X


From: Mark Murray
Subject: Re: [Axiom-developer] -I/usr/include/sys on MacOS X
Date: Mon, 21 Feb 2005 08:18:37 +0000

Pierre Doucy writes:
> (http://lists.apple.com/archives/unix-porting/2004/Feb/msg00062.html).
> The Makefile.pamphlet in the axiom root directory says : 
> 
> "We need to add [[-I/usr/include/sys]] because [[malloc.h]] has been
> moved on this platform."
> 
> What I suggest is to remove the -I/usr/include/sys and add something like
> 
> #ifdef MACOSXplatform
> #include <sys/malloc.h>
> #else
> #include <malloc.h>
> #endif
> 
> Does anyone see a better solution, or can I go on with that ?

This is a very bad idea. sys/malloc.h is the malloc used in the kernel, 
and it does nothing for a BSD-like system WRT malloc()/free(); in fact 
all it is giving you is namespace pollution. MACOS and *BSD just need 
unistd.h to get malloc/free, and it is an error to include the 
deprecated malloc.h.

The above should look like

#ifndef MACOSXplatform
#include <malloc.h>
#endif

or (if unistd.h is not already there)

#ifdef MACOSXplatform
#include <unistd.h>
#else
#include <malloc.h>
#endif

but I doubt that is neceassary.

M
--
Mark Murray
iumop ap!sdn w,I idlaH






reply via email to

[Prev in Thread] Current Thread [Next in Thread]