comparison 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
comparison
equal deleted inserted replaced
621:255297676cd6 622:e7ac3c21c816
23 #ifndef __JEFFPC_MEM_H 23 #ifndef __JEFFPC_MEM_H
24 #define __JEFFPC_MEM_H 24 #define __JEFFPC_MEM_H
25 25
26 #include <stdlib.h> 26 #include <stdlib.h>
27 #include <stdint.h> 27 #include <stdint.h>
28 #include <string.h>
29
30 #include <jeffpc/config.h>
31
32 #ifdef JEFFPC_HAVE_ALLOCA_H
28 #include <alloca.h> 33 #include <alloca.h>
29 #include <string.h> 34 #endif
30 35
31 /* 36 /*
32 * zeroed allocation 37 * zeroed allocation
33 */ 38 */
34 39