diff --git a/netplay.cpp b/netplay.cpp index 61842568..76978ef9 100644 --- a/netplay.cpp +++ b/netplay.cpp @@ -82,7 +82,7 @@ int FCEUNET_SendCommand(uint8 cmd, uint32 len) { //mbg merge 7/17/06 changed to alloca //uint8 buf[numlocal + 1 + 4]; - uint8 *buf = (uint8*)_alloca(numlocal+1+4); + uint8 *buf = (uint8*)alloca(numlocal+1+4); buf[0] = 0xFF; diff --git a/types.h b/types.h index 89908772..19ca2f64 100644 --- a/types.h +++ b/types.h @@ -22,6 +22,8 @@ #ifndef __FCEU_TYPES #define __FCEU_TYPES +#include + #define FCEU_VERSION_NUMERIC 9816 #define FCEU_NAME "FCEUX" #define FCEU_VERSION_STRING "1.07" @@ -47,11 +49,18 @@ typedef signed int int32; #define stat _stat #define fstat _fstat #define mkdir _mkdir +#define alloca _alloca #define W_OK 2 #define R_OK 2 #define X_OK 1 #define F_OK 0 #else + +//mingw32 doesnt prototype this for some reason +#ifdef __MINGW32__ +void *alloca(size_t); +#endif + #include #include #include diff --git a/wave.cpp b/wave.cpp index 62880e84..81abd14b 100644 --- a/wave.cpp +++ b/wave.cpp @@ -18,7 +18,7 @@ void FCEU_WriteWaveData(int32 *Buffer, int Count) { //mbg merge 7/17/06 changed to alloca //int16 temp[Count]; /* Yay. Is this the first use of this "feature" of C in FCE Ultra? */ - int16 *temp = (int16*)_alloca(Count*2); + int16 *temp = (int16*)alloca(Count*2); int16 *dest; int x; @@ -52,7 +52,7 @@ void FCEU_WriteWaveData(int32 *Buffer, int Count) { //mbg merge 7/17/06 changed to alloca //int8 temp2[Count]; - int8 *temp2 = (int8*)_alloca(Count); + int8 *temp2 = (int8*)alloca(Count); int P; for(P=0;P>8))^128;