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.
This commit is contained in:
Paul Eggert 2010-11-20 15:26:39 -08:00
parent 5668bc9791
commit 234d3c3268
2 changed files with 10 additions and 2 deletions

View File

@ -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

View 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);