LTCHIPS / rottexpr

A Rise Of The Triad Source Port with additional gameplay options and more...
GNU General Public License v2.0
97 stars 27 forks source link

Fix build issue when using Mingw-w64 #42

Open mincardona opened 3 years ago

mincardona commented 3 years ago

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.

zZeck commented 3 years ago

I also had this issue using MSYS2 with mingw-w64 to build rottexpr