Skip to content

Comments

Fix build issue when using Mingw-w64#42

Open
mincardona wants to merge 2 commits intoLTCHIPS:masterfrom
mincardona:fix-mingw64-build
Open

Fix build issue when using Mingw-w64#42
mincardona wants to merge 2 commits intoLTCHIPS:masterfrom
mincardona:fix-mingw64-build

Conversation

@mincardona
Copy link

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.

This means alloca.h is no longer required
@zZeck
Copy link

zZeck commented Apr 11, 2021

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

@zZeck zZeck mentioned this pull request Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants