--- src/frame.c
+++ src/frame.c	2009-08-10 18:14:44.841901682 +0200
@@ -21,6 +21,9 @@ along with GNU Emacs.  If not, see <http
 
 #include <stdio.h>
 #include <ctype.h>
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
 #include "lisp.h"
 #include "character.h"
 #ifdef HAVE_X_WINDOWS