On 2009-03-09 16:19+0100 Werner Smekal wrote:

> Hi Alan,
>
> good idea to include the library. On Mac OS X (but only later versions, 10.4 
> upwards or so) malloc.h must be included with
>
> #include <malloc/malloc.h>
>
> and not with
>
> #include <malloc.h>
>
> I took the easy route and defined for Mac OS X NOMALLOCH in the corresponding 
> CMakeLists.txt (Revision 9683) so that malloc.h is not included. But I think 
> we shouldn't include malloc.h, since normal alloc/calloc/free calls are 
> defined somewhere else anyway. Could you check in Linux if removing the 
> include of malloc.h leads to problems? If not, I think we could remove it and 
> revert CMakeLists.txt.

Hi Werner:

Thanks for spotting this issue, and making a good first try at dealing with
it.

Dropping it for Linux works fine (as predicted by Andrew).  However, instead
of ripping out

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

from the code in the three places where that occurs, I decided to do
everything from CMake, and effectively did that same thing by using a small
change of what you did.

This preserves the original code exactly, and already is proved to work for
Linux and Mac OS X.  If it works for Windows and proprietary Unix as well,
that is great, but if not, this method still allows us to deal at the CMake
level with platforms where #include <malloc.h> is actually needed in that
form.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to