Index: config/auto/headers.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/headers.pl,v
retrieving revision 1.7
diff -u -a -r1.7 headers.pl
--- config/auto/headers.pl	26 Jun 2003 13:11:22 -0000	1.7
+++ config/auto/headers.pl	11 Jul 2003 13:47:39 -0000
@@ -28,7 +28,7 @@
     # some headers may not be probed-for by perl 5, or might not be
     # properly reflected in %Config (i_fcntl seems to be wrong on my machine,
     # for instance).
-    my @extra_headers = qw(fcntl.h setjmp.h pthread.h signal.h);
+    my @extra_headers = qw(malloc.h fcntl.h setjmp.h pthread.h signal.h);
 
     foreach my $header (@extra_headers) {
         my $flag = "i_$header";
Index: config/auto/memalign.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign.pl,v
retrieving revision 1.3
diff -u -a -r1.3 memalign.pl
--- config/auto/memalign.pl	11 Jun 2003 20:26:47 -0000	1.3
+++ config/auto/memalign.pl	11 Jul 2003 13:47:39 -0000
@@ -9,6 +9,13 @@
 sub runstep {
     my $test = 0;
 
+    if (Configure::Data->get('i_malloc')) {
+	Configure::Data->set('malloc_header', 'malloc.h');
+    }
+    else {
+	Configure::Data->set('malloc_header', 'stdlib.h');
+    }
+
     cc_gen('config/auto/memalign/test_c.in');
     eval { cc_build(); };
     unless ($@ || cc_run() !~ /ok/) {
@@ -24,6 +31,8 @@
 	$test2 = 1;
     }
     cc_clean();
+
+    Configure::Data->set('malloc_header', undef);
 
     my $f = $test2 ? 'posix_memalign' :
             $test  ? 'memalign'       : '';
Index: config/auto/signal.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/signal.pl,v
retrieving revision 1.2
diff -u -a -r1.2 signal.pl
--- config/auto/signal.pl	11 Jul 2003 12:25:06 -0000	1.2
+++ config/auto/signal.pl	11 Jul 2003 13:47:39 -0000
@@ -18,6 +18,14 @@
     if (defined $miniparrot) {
 	return;
     }
+
+    if (Configure::Data->get('i_malloc')) {
+	Configure::Data->set('malloc_header', 'malloc.h');
+    }
+    else {
+	Configure::Data->set('malloc_header', 'stdlib.h');
+    }
+
     cc_gen('config/auto/signal/test_1.in');
     eval { cc_build(); };
     unless ($@ || cc_run() !~ /ok/) {
@@ -37,6 +45,8 @@
 	print " (sigaction)";
     }
     cc_clean();
+
+    Configure::Data->set('malloc_header', undef);
 
     # now generate signal constants
     open O, ">runtime/parrot/include/signal.pasm" or die
Index: config/auto/gc/test_c.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/gc/test_c.in,v
retrieving revision 1.1
diff -u -a -r1.1 test_c.in
--- config/auto/gc/test_c.in	5 Oct 2002 09:40:35 -0000	1.1
+++ config/auto/gc/test_c.in	11 Jul 2003 13:47:39 -0000
@@ -4,7 +4,7 @@
  * This file is automatically generated by Configure
  * from gc.in.
  */
-#include <malloc.h>
+#include <${malloc_header}>
 #include <stdio.h>
 int main(int argc, char **argv) {
         void *p = malloc(128);
Index: config/auto/memalign/test_c.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign/test_c.in,v
retrieving revision 1.3
diff -u -a -r1.3 test_c.in
--- config/auto/memalign/test_c.in	19 Jun 2003 14:39:18 -0000	1.3
+++ config/auto/memalign/test_c.in	11 Jul 2003 13:47:39 -0000
@@ -4,7 +4,7 @@
  * This file is automatically generated by Configure
  * from test_c.in.
  */
-#include <malloc.h>
+#include <${malloc_header}>
 #include <stdio.h>
 
 int main(int argc, char **argv) {
Index: config/auto/memalign/test_c2.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/memalign/test_c2.in,v
retrieving revision 1.2
diff -u -a -r1.2 test_c2.in
--- config/auto/memalign/test_c2.in	19 Jun 2003 14:39:18 -0000	1.2
+++ config/auto/memalign/test_c2.in	11 Jul 2003 13:47:39 -0000
@@ -4,7 +4,7 @@
  * This file is automatically generated by Configure
  * from test_c.in.
  */
-#include <malloc.h>
+#include <${malloc_header}>
 #include <stdlib.h>
 #include <stdio.h>
 
Index: config/auto/signal/test_1.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/signal/test_1.in,v
retrieving revision 1.2
diff -u -a -r1.2 test_1.in
--- config/auto/signal/test_1.in	11 Jul 2003 12:25:10 -0000	1.2
+++ config/auto/signal/test_1.in	11 Jul 2003 13:47:39 -0000
@@ -4,7 +4,7 @@
  * This file is automatically generated by Configure
  * from test_1.in.
  */
-#include <malloc.h>
+#include <${malloc_header}>
 #include <stdio.h>
 #include <signal.h>
 
Index: config/auto/signal/test_2.in
===================================================================
RCS file: /cvs/public/parrot/config/auto/signal/test_2.in,v
retrieving revision 1.1
diff -u -a -r1.1 test_2.in
--- config/auto/signal/test_2.in	11 Jul 2003 11:31:55 -0000	1.1
+++ config/auto/signal/test_2.in	11 Jul 2003 13:47:39 -0000
@@ -4,7 +4,7 @@
  * This file is automatically generated by Configure
  * from test_2.in.
  */
-#include <malloc.h>
+#include <${malloc_header}>
 #include <stdio.h>
 #include <signal.h>
 
Index: config/gen/platform/generic.c
===================================================================
RCS file: /cvs/public/parrot/config/gen/platform/generic.c,v
retrieving revision 1.11
diff -u -a -r1.11 generic.c
--- config/gen/platform/generic.c	11 Jul 2003 11:31:59 -0000	1.11
+++ config/gen/platform/generic.c	11 Jul 2003 13:47:39 -0000
@@ -156,7 +156,12 @@
 }
 
 #elif defined(HAS_MEMALIGN)
+
+#if defined(HAS_HEADER_MALLOC)
 #include <malloc.h>
+#else
+#include <stdlib.h>
+#endif
 
 void *
 Parrot_memalign(size_t align, size_t size)
w_Šv¥—&œ¢êez‡ì™©e¥«\…ë- Æ¤yø¥zÊ-zËfj)àzÛ+zj/yÜ!zw%y©âž§uø±yÖ¦z{b¢zµë-™¨§                                        