This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH (libstdc++-v3): Port testsuite/testsuite_performance.h


On Tue, Jun 24, 2003 at 02:27:29PM -0500, B. Kosnik wrote:
> 
> >Frankly, I'd rather unconditionally kill it.  This is in test code not
> >run by most non-developers at this point. 
> 
> I think you should just do it in a way that works for BSD. As you say,
> let's not get overly wrapped-up in making this work everywhere.

Imho, the correct way to do this for almost all platforms is:

#ifdef STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#else /* !STDC_HEADERS */
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#else
#ifdef HAVE_SYS_MALLOC_H
#include <sys/malloc.h>
#endif /* HAVE_SYS_MALLOC_H */
#endif /* HAVE_MALLOC_H */
#endif /* !STDC_HEADERS */


Of course, you'll need to add the autoconf tests
for STDC_HEADERS, HAVE_MALLOC_H and HAVE_SYS_MALLOC_H:

AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h sys/malloc.h)


Regards,

-- 
Carlo Wood <carlo@alinoe.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]