]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autoconf: don't assume sys/stat.h and sys/types.h when testing C89
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Nov 2010 23:26:39 +0000 (15:26 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Nov 2010 23:27:16 +0000 (15:27 -0800)
Problem reported by Patrick Pelissier in
<http://lists.gnu.org/archive/html/bug-autoconf/2010-11/msg00019.html>.
* lib/autoconf/c.m4 (_AC_PROG_CC_C89): Don't include sys/types.h
and sys/stat.h.  Instead, define a dummy struct stat.  C89 doesn't
guarantee sys/types.h and sys/stat.h.

ChangeLog
lib/autoconf/c.m4

index e34119ca621853e259a7c51539f5c5b180cb4d76..62358eafd517714cd20c84283279751045b66243 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-11-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       autoconf: don't assume sys/stat.h and sys/types.h when testing C89
+       Problem reported by Patrick Pelissier in
+       <http://lists.gnu.org/archive/html/bug-autoconf/2010-11/msg00019.html>.
+       * lib/autoconf/c.m4 (_AC_PROG_CC_C89): Don't include sys/types.h
+       and sys/stat.h.  Instead, define a dummy struct stat.  C89 doesn't
+       guarantee sys/types.h and sys/stat.h.
+
 2010-11-10  Reuben Thomas  <rrt@sc3d.org>  (tiny change)
 
        docs: avoid first person, and credit history to David MacKenzie
index 233644a0c7c18fc6cec0f38ee5995cc854347b04..a873ccd2040195ad267a331c7684cc8bb6b646cd 100644 (file)
@@ -1102,8 +1102,7 @@ AC_DEFUN([_AC_PROG_CC_C89],
 [_AC_C_STD_TRY([c89],
 [[#include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);