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:
stijn 2014-05-03 10:14:16 +02:00
parent 8f472ad577
commit 98e2ee0ec1
3 changed files with 3 additions and 10 deletions

View File

@ -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"

View File

@ -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
View File

@ -0,0 +1 @@
#include <malloc.h>