[MPlayer-dev-eng] [PATCH] check for and include alloca.h for ALSA stuff

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Jul 16 20:44:35 CEST 2008


Hello,
the way we use ALSA currently needs alloca, and for this to be at least
somewhat portable, alloca.h should be included.
Attached patch in addition also disables ALSA (with an appropriate
message) if alloca is not available.
Ok to apply?

Greetings,
Reimar Döffinger
-------------- next part --------------
diff --git a/configure b/configure
index 723da82..334ad3e 100755
--- a/configure
+++ b/configure
@@ -5195,6 +5195,10 @@ fi
 echores "$_openal"
 
 echocheck "ALSA audio"
+if test "$_alloca" != yes ; then
+  _alsa=no
+  _res_comment="alloca missing"
+fi
 if test "$_alsa" != no ; then
   _alsa=no
   cat > $TMPC << EOF
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c
index 0d925ce..987713e 100644
--- a/libao2/ao_alsa.c
+++ b/libao2/ao_alsa.c
@@ -19,6 +19,7 @@
 #include <ctype.h>
 #include <math.h>
 #include <string.h>
+#include <alloca.h>
 
 #include "config.h"
 #include "subopt-helper.h"
diff --git a/stream/ai_alsa.c b/stream/ai_alsa.c
index a1468be..84d0aa5 100644
--- a/stream/ai_alsa.c
+++ b/stream/ai_alsa.c
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
+#include <alloca.h>
 
 #include "config.h"
 
diff --git a/stream/ai_alsa1x.c b/stream/ai_alsa1x.c
index 455c641..aab42e3 100644
--- a/stream/ai_alsa1x.c
+++ b/stream/ai_alsa1x.c
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
+#include <alloca.h>
 
 #include "config.h"
 


More information about the MPlayer-dev-eng mailing list