Fix nativeapi.pm so it knows about AC_HEADER_STAT().

Make the error message about unexpected '#ifdef HAVE_XXX' clearer.
Protect sys/stat.h #includes with the corresponding '#ifdef HAVE_XXX'
check.
This commit is contained in:
Francois Gouget 2005-05-06 16:22:54 +00:00 committed by Alexandre Julliard
parent 2dabac08ee
commit 821d4c4645
24 changed files with 73 additions and 25 deletions

View File

@ -21,7 +21,9 @@
#include "config.h"
#include <stdarg.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include "windef.h"
#include "winbase.h"

View File

@ -24,7 +24,9 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>

View File

@ -33,7 +33,9 @@
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif

View File

@ -25,7 +25,9 @@
#include <stdarg.h>
#include <stdlib.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <string.h>
#include <dirent.h>
#include <stdio.h>

View File

@ -65,7 +65,9 @@
#endif
#include <errno.h>
#include <ctype.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif

View File

@ -25,7 +25,9 @@
#include <ctype.h>
#include <stdarg.h>
#include <string.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <signal.h>
#include "windef.h"

View File

@ -27,7 +27,9 @@
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h>
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>

View File

@ -28,7 +28,9 @@
# include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <string.h>
#include <stdarg.h>

View File

@ -16,12 +16,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <ctype.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h>
#include "mpg123.h"

View File

@ -34,7 +34,9 @@
# include <unistd.h>
#endif
#include <fcntl.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_IOCTL_H

View File

@ -34,7 +34,9 @@
#ifdef HAVE_MNTENT_H
#include <mntent.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif

View File

@ -23,7 +23,9 @@
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include "windef.h"
#include "winbase.h"

View File

@ -43,7 +43,9 @@
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif

View File

@ -18,12 +18,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#include <dirent.h>
#include <sys/stat.h>
#include <pwd.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
#include <grp.h>
#define COBJMACROS

View File

@ -23,7 +23,6 @@
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <memory.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif

View File

@ -26,7 +26,7 @@
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <memory.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif

View File

@ -28,7 +28,9 @@
#include <stdarg.h>
#include <stdio.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif

View File

@ -33,7 +33,9 @@
# include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif

View File

@ -27,7 +27,9 @@
#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h>
#include <errno.h>
#ifdef HAVE_SYS_IOCTL_H

View File

@ -22,7 +22,7 @@
#include "wine/port.h"
#include <fcntl.h>
#include <memory.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>

View File

@ -99,7 +99,9 @@
# define HAVE_IPX
#endif
#ifdef HAVE_IPX_LINUX
# include <asm/types.h>
# ifdef HAVE_ASM_TYPES_H
# include <asm/types.h>
# endif
# include <linux/ipx.h>
# define HAVE_IPX
#endif

View File

@ -68,7 +68,9 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h>
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>

View File

@ -110,6 +110,14 @@ sub new($) {
foreach my $name (split(/\s+/, $headers)) {
$$conditional_headers{$name}++;
}
} elsif(/AC_HEADER_STAT\(\)/) {
# This checks for a bunch of standard headers
# There's stdlib.h, string.h and sys/types.h too but we don't
# want to force ifdefs for those at this point.
foreach my $name ("sys/stat.h", "memory.h", "strings.h",
"inttypes.h", "stdint.h", "unistd.h") {
$$conditional_headers{$name}++;
}
} elsif(/AC_CHECK_FUNCS\(\s*([^,\)]*)(?:,|\))?/) {
my $funcs = $1;
$funcs =~ s/^\s*\[\s*(.*?)\s*\]\s*$/$1/;

View File

@ -583,8 +583,7 @@ foreach my $file (@c_files) {
}
}
} elsif($preprocessor->is_def($macro)) {
$output->write("$file: #$directive $argument: is protected, " .
"but is not a conditional include\n");
$output->write("$file: #$directive $argument: is protected, but there is no check for it in configure.ac\n");
}
}