summaryrefslogtreecommitdiffstats
path: root/alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'alloc.h')
-rw-r--r--alloc.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/alloc.h b/alloc.h
index 70122ce..c430091 100644
--- a/alloc.h
+++ b/alloc.h
@@ -19,10 +19,16 @@
#ifndef _alloc_h_
#define _alloc_h_
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#else /* not HAVE_STDLIB_H */
+#if HAVE_MALLOC_H
#include <malloc.h>
+#endif /* HAVE_MALLOC_H */
+#endif /* not HAVE_STDLIB_H */
-#define CALLOC(type, n) ((type *)calloc(sizeof(type), (n)))
-#define MALLOC(type, n) ((type *)malloc(sizeof(type) * (n)))
-#define REALLOC(old, type, n) ((type *)realloc((old), sizeof(type) * (n)))
+#define CALLOC(type, n) ((type *) calloc (sizeof (type), (n)))
+#define MALLOC(type, n) ((type *) malloc (sizeof (type) * (n)))
+#define REALLOC(old, type, n) ((type *) realloc ((old), sizeof (type) * (n)))
#endif /* not _alloc_h_ */