w_wad.c includes <alloca.h> in order to use the alloca() function. This header does not exist when compiling using Mingw-w64 on my machine, causing a build error. Instead, alloca() is available through stdlib.h, which includes malloc.h.
This patch replaces the alloca() call with malloc()/free(), which removes the need for the header file altogether and also removes the potential for a stack overflow.
The README says MinGW was used to build the release; I'm curious why this issue didn't arise then too.
w_wad.c
includes<alloca.h>
in order to use thealloca()
function. This header does not exist when compiling using Mingw-w64 on my machine, causing a build error. Instead,alloca()
is available throughstdlib.h
, which includesmalloc.h
.This patch replaces the
alloca()
call withmalloc()
/free()
, which removes the need for the header file altogether and also removes the potential for a stack overflow.The README says MinGW was used to build the release; I'm curious why this issue didn't arise then too.