mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
py: Use <alloca.h> for alloca()
alloca() is declared in alloca.h which als happens to be included by stdlib.h. On mingw however it resides in malloc.h only. So if we include alloca.h directly, and add an alloca.h for mingw in it's port directory we can get rid of the mingw-specific define to include malloc.h and the other ports are happy as well.
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#ifdef __MINGW32__
|
||||
// For alloca()
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <alloca.h>
|
||||
|
||||
#include "mpconfig.h"
|
||||
#include "nlr.h"
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#ifdef __MINGW32__
|
||||
// For alloca()
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <alloca.h>
|
||||
|
||||
#include "mpconfig.h"
|
||||
#include "nlr.h"
|
||||
|
||||
1
windows/alloca.h
Normal file
1
windows/alloca.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <malloc.h>
|
||||
Reference in New Issue
Block a user