summaryrefslogtreecommitdiff
path: root/toxcore/ccompat.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-01-22 09:37:31 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-01-22 21:05:30 +0000
commit8f1bbcf83e23286ebdfd17b83d886fc8f0a3eb2a (patch)
tree8b73a35a6104159f5055f1e0b42a63004758bc8f /toxcore/ccompat.h
parente6c04ef0287a69c453f129778ef35932e0dff4b2 (diff)
Use <stdlib.h> for alloca on FreeBSD.
https://www.freebsd.org/cgi/man.cgi?alloca If stdlib.h does not define alloca, and we're using GCC (or Clang), we define the macro ourselves in terms of a GCC builtin.
Diffstat (limited to 'toxcore/ccompat.h')
-rw-r--r--toxcore/ccompat.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/toxcore/ccompat.h b/toxcore/ccompat.h
index e72e66ae..05212ec5 100644
--- a/toxcore/ccompat.h
+++ b/toxcore/ccompat.h
@@ -29,6 +29,11 @@
29// Emulation using alloca. 29// Emulation using alloca.
30#ifdef _WIN32 30#ifdef _WIN32
31#include <malloc.h> 31#include <malloc.h>
32#elif defined(__FreeBSD__)
33#include <stdlib.h>
34#if !defined(alloca) && defined(__GNUC__)
35#define alloca __builtin_alloca
36#endif
32#else 37#else
33#include <alloca.h> 38#include <alloca.h>
34#endif 39#endif