diff include/jeffpc/mem.h @ 622:e7ac3c21c816

mem: include alloca.h only if it exists Some OSes (notably FreeBSD) do not have alloca.h at all. Instead, they define alloca in stdlib.h. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sat, 03 Nov 2018 07:43:27 -0400
parents 73bad8a04d54
children d018af7c979c
line wrap: on
line diff
--- a/include/jeffpc/mem.h	Sat Nov 03 07:54:45 2018 -0400
+++ b/include/jeffpc/mem.h	Sat Nov 03 07:43:27 2018 -0400
@@ -25,8 +25,13 @@
 
 #include <stdlib.h>
 #include <stdint.h>
+#include <string.h>
+
+#include <jeffpc/config.h>
+
+#ifdef JEFFPC_HAVE_ALLOCA_H
 #include <alloca.h>
-#include <string.h>
+#endif
 
 /*
  * zeroed allocation