diff options
Diffstat (limited to 'alloc.h')
-rw-r--r-- | alloc.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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_ */ |