From 234d3c32688c335ee19e8d7f409e713badb5c669 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 20 Nov 2010 15:26:39 -0800 Subject: [PATCH] autoconf: don't assume sys/stat.h and sys/types.h when testing C89 Problem reported by Patrick Pelissier in . * 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 | 9 +++++++++ lib/autoconf/c.m4 | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e34119ca..62358eaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-11-20 Paul Eggert + + autoconf: don't assume sys/stat.h and sys/types.h when testing C89 + Problem reported by Patrick Pelissier in + . + * 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 (tiny change) docs: avoid first person, and credit history to David MacKenzie diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 233644a0..a873ccd2 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1102,8 +1102,7 @@ AC_DEFUN([_AC_PROG_CC_C89], [_AC_C_STD_TRY([c89], [[#include #include -#include -#include +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); -- 2.47.2