--- mi_alloc.c
+++ mi_alloc.c
@@ -9,6 +9,8 @@
 #include "mi_spans.h"
 #include "mi_api.h"
 
+#include <stdlib.h>
+
 /* wrapper for malloc() */
 voidptr_t 
 #ifdef _HAVE_PROTOS

--- mi_arc.c
+++ mi_arc.c
@@ -29,6 +29,8 @@
 #include "mi_fply.h"		/* for miFillSppPoly() */
 #include "mi_fllarc.h"		/* for MIWIDEARCSETUP, MIFILLINARCSTEP etc. */
 
+#include <stdlib.h>
+
 /* undefine if cbrt(), a fast cube root function for non-negative
    arguments, is available */
 #define cbrt(x) pow((x), 1.0/3.0)
