summaryrefslogtreecommitdiff
path: root/libstdc++
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-05 09:41:22 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-05 09:41:22 +0000
commit5288a864303b0a488673e4d9c54689208d8fcc0b (patch)
tree64be7d1dfffd4fb0be0d0d056fbd25452f3e8c31 /libstdc++
parent4bb7fbc5fd9eac97d527c1f64faf8271c41a7057 (diff)
downloadgcc-5288a864303b0a488673e4d9c54689208d8fcc0b.tar.gz
* std/std_valarray.h: Don't #include unconditionally <alloca.h>
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27364 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++')
-rw-r--r--libstdc++/ChangeLog6
-rw-r--r--libstdc++/std/std_valarray.h26
2 files changed, 30 insertions, 2 deletions
diff --git a/libstdc++/ChangeLog b/libstdc++/ChangeLog
index a5811cf0c6c..90723b9999d 100644
--- a/libstdc++/ChangeLog
+++ b/libstdc++/ChangeLog
@@ -1,4 +1,8 @@
-1999-06-06 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
+1999-06-05 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
+
+ * std/std_valarray.h: Don't #include unconditionally <alloca.h>
+
+1999-06-05 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
* std/std_valarray.h: New file.
* std/slice.h: New file.
diff --git a/libstdc++/std/std_valarray.h b/libstdc++/std/std_valarray.h
index 2ac02371413..975d0a122ad 100644
--- a/libstdc++/std/std_valarray.h
+++ b/libstdc++/std/std_valarray.h
@@ -40,7 +40,31 @@
#include <functional>
#include <algorithm>
-#include <alloca.h> // XXX non-standard.
+#ifndef alloca
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#include <alloca.h>
+#else /* not sparc */
+#if defined (MSDOS) && !defined (__TURBOC__)
+#include <malloc.h>
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+#include <malloc.h>
+ #pragma alloca
+#else /* not MSDOS, __TURBOC__, or _AIX */
+#ifdef __hpux
+#endif /* __hpux */
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc. */
+#endif /* not GNU C. */
+#endif /* alloca not defined. */
+
+extern "C" {
+ void* alloca(size_t);
+}
extern "C++" {