ada: fix i686-w64-mingw32 build
Commit Message
For __MINGW32__, we need to include <stdlib.h> for malloc.
gcc/ada/ChangeLog:
PR ada/123037
* rtinit.c: Include <stdlib.h> for __MINGW32__.
---
OK? I can swap the order of includes if preferred so stdlib.h comes before windows.h,
but I'm not familiar enough with Windows and I wasn't sure if <windows.h> would ever
set macros that stdlib.h needs.
gcc/ada/rtinit.c | 1 +
1 file changed, 1 insertion(+)
Comments
> 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>.
@@ -73,6 +73,7 @@ int __gnat_rt_init_count = 0;
#define WIN32_LEAN_AND_MEAN
#include "mingw32.h"
#include <windows.h>
+#include <stdlib.h>
extern void __gnat_init_float (void);