Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build issue when using Mingw-w64 #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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