On Fri, Sep 16, 2011 at 06:00:00PM -0700, Miller Puckette wrote: > > Perhaps the easiest way is to let configure check for alloca.h and > > stdlib.h and include one or the other, depending on what's available > > on the system. Would you like diffs for that?
The attached changes use alloca.h or malloc.h, whichever's available, and still compiles for me. I hope this still works on Windows, otherwise I don't expect problems. (I didn't resend the unaffected patches from the patchset.) Thomas
$NetBSD$ --- configure.ac.orig 2011-02-02 04:42:27.000000000 +0000 +++ configure.ac @@ -214,7 +214,7 @@ AM_CONDITIONAL(FFTW, test x$fftw = xyes) # Checks for header files. AC_FUNC_ALLOCA -AC_CHECK_HEADERS([fcntl.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/soundcard.h sys/time.h sys/timeb.h unistd.h]) +AC_CHECK_HEADERS([alloca.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/soundcard.h sys/time.h sys/timeb.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_INT16_T
$NetBSD: patch-extra_bonk~_bonk~.c,v 1.1.1.1 2011/09/15 01:05:05 wiz Exp $ alloca.h is not portable. --- extra/bonk~/bonk~.c.orig 2010-08-19 01:37:00.000000000 +0000 +++ extra/bonk~/bonk~.c @@ -82,10 +82,10 @@ void *bonk_class; static t_class *bonk_class; #endif -#ifdef _WIN32 -#include <malloc.h> -#elif ! defined(_MSC_VER) +#if defined(HAVE_ALLOCA_H) #include <alloca.h> +#elsif defined(HAVE_MALLOC_H) +#include <malloc.h> #endif /* ------------------------ bonk~ ----------------------------- */
$NetBSD: patch-extra_sigmund~_sigmund~.c,v 1.1.1.1 2011/09/15 01:05:05 wiz Exp $ alloca.h is not portable. --- extra/sigmund~/sigmund~.c.orig 2010-07-28 20:55:17.000000000 +0000 +++ extra/sigmund~/sigmund~.c @@ -26,10 +26,10 @@ for example, defines this in the file d_ #include <math.h> #include <stdio.h> #include <string.h> -#ifdef _WIN32 -#include <malloc.h> -#elif ! defined(_MSC_VER) +#if defined(HAVE_ALLOCA_H) #include <alloca.h> +#elsif defined(HAVE_MALLOC_H) +#include <malloc.h> #endif #include <stdlib.h> #ifdef _MSC_VER
$NetBSD: patch-src_m__binbuf.c,v 1.1.1.1 2011/09/15 01:05:05 wiz Exp $ alloca.h is not portable. --- src/m_binbuf.c.orig 2011-03-10 06:02:41.000000000 +0000 +++ src/m_binbuf.c @@ -530,10 +530,10 @@ done: #define SMALLMSG 5 #define HUGEMSG 1000 -#ifdef MSW -#include <malloc.h> -#else +#if defined(HAVE_ALLOCA_H) #include <alloca.h> +#elsif defined(HAVE_MALLOC_H) +#include <malloc.h> #endif #if HAVE_ALLOCA #define ATOMS_ALLOCA(x, n) ((x) = (t_atom *)((n) < HUGEMSG ? \
$NetBSD: patch-src_s__utf8.c,v 1.1.1.1 2011/09/15 01:05:05 wiz Exp $ alloca.h is not portable. --- src/s_utf8.c.orig 2010-08-18 03:51:01.000000000 +0000 +++ src/s_utf8.c @@ -18,10 +18,10 @@ #include <stdio.h> #include <string.h> #include <stdarg.h> -#ifdef WIN32 -#include <malloc.h> -#else +#if defined(HAVE_ALLOCA_H) #include <alloca.h> +#elsif defined(HAVE_MALLOC_H) +#include <malloc.h> #endif #include "s_utf8.h"
$NetBSD: patch-src_x__list.c,v 1.1.1.1 2011/09/15 01:05:05 wiz Exp $ alloca.h is not portable. --- src/x_list.c.orig 2010-07-21 18:37:47.000000000 +0000 +++ src/x_list.c @@ -4,10 +4,10 @@ #include "m_pd.h" /* #include <string.h> */ -#ifdef MSW -#include <malloc.h> -#else +#if defined(HAVE_ALLOCA_H) #include <alloca.h> +#elsif defined(HAVE_MALLOC_H) +#include <malloc.h> #endif extern t_pd *newest;
_______________________________________________ Pd-dev mailing list [email protected] http://lists.puredata.info/listinfo/pd-dev
