fix bug in partial writes
[ghc-base.git] / aclocal.m4
index 49ad919..615cbe1 100644 (file)
@@ -135,15 +135,17 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
 # include <sys/resource.h>
 #endif
 
+#include <stdlib.h>
+
 typedef $1 testing;
 
-main() {
+int main(void) {
   FILE *f=fopen("conftestval", "w");
   if (!f) exit(1);
   if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {
     fprintf(f, "%s%d\n",
            ((testing)(-1) < (testing)0) ? "Int" : "Word",
-           sizeof(testing)*8);
+           (int)(sizeof(testing)*8));
   } else {
     fprintf(f,"%s\n",
            (sizeof(testing) >  sizeof(double)) ? "LDouble" :
@@ -177,6 +179,8 @@ AC_DEFUN([FP_READDIR_EOF_ERRNO],
 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <dirent.h>
 #include <stdio.h>
 #include <errno.h>
+#include <sys/stat.h>
+
 int
 main(argc, argv)
 int argc;