* std/std_valarray.h: Don't #include unconditionally <alloca.h>
authorGabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
Sat, 5 Jun 1999 09:41:22 +0000 (11:41 +0200)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sat, 5 Jun 1999 09:41:22 +0000 (09:41 +0000)
From-SVN: r27364

libstdc++/ChangeLog
libstdc++/std/std_valarray.h

index a5811cf0c6c2dd44f7fbe7ab326ac2b61d507f6d..90723b9999d0329c84a0ba18e3389a4c1cff97e1 100644 (file)
@@ -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.
index 2ac0237141367c6052d4a72e241452a6b10b86ef..975d0a122ad311a1522a474f62f40d9482afa182 100644 (file)
 #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++" {