aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/compat.h
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-18 17:01:41 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-18 17:01:41 +0000
commit1c0212aaba9cde077488261f13b57cccb6095b67 (patch)
tree6c551f448f7ea343ac4828c885d9de90ec86472d /include/asterisk/compat.h
parentf2c0ead18c518617a519349f78017bf5454647fc (diff)
Change how we handle alloca to conform with how it is suggested in the autoconf manual for AC_FUNC_ALLOCA. FreeBSD 6 now builds again and no other platforms should be broken by this.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89396 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/compat.h')
-rw-r--r--include/asterisk/compat.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/asterisk/compat.h b/include/asterisk/compat.h
index ced14fc41..0dd3685d6 100644
--- a/include/asterisk/compat.h
+++ b/include/asterisk/compat.h
@@ -52,9 +52,14 @@
#endif
#ifdef HAVE_ALLOCA_H
-#include <alloca.h> /* not necessarily present - could be in stdlib */
-#elif defined(HAVE_ALLOCA)
-#include <malloc.h> /* see if it is here... */
+#include <alloca.h>
+#elif defined(__GNUC__)
+#define alloca __builtin_alloca
+#elif defined(_AIX)
+#define alloca __alloca
+#elif defined(_MSC_VER)
+#include <malloc.h>
+#define alloca _alloca
#endif
#include <stdio.h> /* this is always present */