> For __MINGW32__, we need to include <stdlib.h> for malloc.
> 
> gcc/ada/ChangeLog:
>       PR ada/123037
>       * rtinit.c: Include <stdlib.h> for __MINGW32__.

OK, but please include it before mingw32.h and let's remove some duplication 
in the  process:


        PR ada/123037
        * rtinit.c [__MINGW32__]: Include <stdlib.h> and not <windows.h>.
        * rtfinal.c [__MINGW32__]: Do not include <windows.h>.

-- 
Eric Botcazou
diff --git a/gcc/ada/rtfinal.c b/gcc/ada/rtfinal.c
index 88bbb0e3e50..0bd3ce4ace6 100644
--- a/gcc/ada/rtfinal.c
+++ b/gcc/ada/rtfinal.c
@@ -46,9 +46,7 @@ extern int __gnat_rt_init_count;
 /*  see initialize.c  */
 
 #if defined (__MINGW32__)
-#define WIN32_LEAN_AND_MEAN
 #include "mingw32.h"
-#include <windows.h>
 
 extern CRITICAL_SECTION ProcListCS;
 extern HANDLE ProcListEvt;
diff --git a/gcc/ada/rtinit.c b/gcc/ada/rtinit.c
index 598550c4051..3b5af0dfb01 100644
--- a/gcc/ada/rtinit.c
+++ b/gcc/ada/rtinit.c
@@ -70,9 +70,8 @@ int __gnat_rt_init_count = 0;
    and finalize properly the run-time. */
 
 #if defined (__MINGW32__)
-#define WIN32_LEAN_AND_MEAN
+#include <stdlib.h>
 #include "mingw32.h"
-#include <windows.h>
 
 extern void __gnat_init_float (void);
 

Reply via email to