use HAVE_STDLIB_H and HAVE_MALLOC_H to include proper header file for calloc()