SNMetamorph / PrimeXT

Modern Half-Life 1 SDK for Xash3D FWGS engine, has enhanced graphics and physics and a lot of new features for mod-makers. Crossplatform, supports Windows/Linux. Based on XashXT and Spirit Of Half-Life.
https://snmetamorph.github.io/PrimeXT/
108 stars 30 forks source link

game_shared: include malloc.h on win32, otherwise use alloca.h #213

Closed a1batross closed 2 months ago

a1batross commented 2 months ago

alloca() is a nonstandard function, and its definition location depends on the platform.

Ideally, we test which header defines it, on Win32 it's malloc.h as per the documentation, on *nixes it's usually alloca.h, but sometimes it's even stdlib.h.

For now, just include alloca.h to fix building on macOS (thanks @FiEctro for the help!)