Commit 821d4c46 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

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.
parent 2dabac08
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
#include "config.h" #include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
......
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h> #include <sys/mman.h>
......
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h> #include <sys/mman.h>
#endif #endif
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <string.h> #include <string.h>
#include <dirent.h> #include <dirent.h>
#include <stdio.h> #include <stdio.h>
......
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
#endif #endif
#include <errno.h> #include <errno.h>
#include <ctype.h> #include <ctype.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_FILIO_H #ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h> # include <sys/filio.h>
#endif #endif
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#include <ctype.h> #include <ctype.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <signal.h> #include <signal.h>
#include "windef.h" #include "windef.h"
......
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
......
...@@ -16,12 +16,15 @@ ...@@ -16,12 +16,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h"
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include "mpg123.h" #include "mpg123.h"
......
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
......
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
#ifdef HAVE_MNTENT_H #ifdef HAVE_MNTENT_H
#include <mntent.h> #include <mntent.h>
#endif #endif
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
......
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
#include <stdarg.h> #include <stdarg.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
......
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h> #include <sys/mman.h>
#endif #endif
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_UIO_H #ifdef HAVE_SYS_UIO_H
#include <sys/uio.h> #include <sys/uio.h>
#endif #endif
......
...@@ -18,12 +18,17 @@ ...@@ -18,12 +18,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h"
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
#include <dirent.h> #include <dirent.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
#include <pwd.h> # include <sys/stat.h>
#endif
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
#include <grp.h> #include <grp.h>
#define COBJMACROS #define COBJMACROS
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <memory.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <memory.h> #include <string.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
......
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
# include <sys/time.h> # include <sys/time.h>
#endif #endif
......
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "wine/port.h" #include "wine/port.h"
#include <fcntl.h> #include <fcntl.h>
#include <memory.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
......
...@@ -99,7 +99,9 @@ ...@@ -99,7 +99,9 @@
# define HAVE_IPX # define HAVE_IPX
#endif #endif
#ifdef HAVE_IPX_LINUX #ifdef HAVE_IPX_LINUX
# include <asm/types.h> # ifdef HAVE_ASM_TYPES_H
# include <asm/types.h>
# endif
# include <linux/ipx.h> # include <linux/ipx.h>
# define HAVE_IPX # define HAVE_IPX
#endif #endif
......
...@@ -68,7 +68,9 @@ ...@@ -68,7 +68,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h> # include <sys/mman.h>
......
...@@ -110,6 +110,14 @@ sub new($) { ...@@ -110,6 +110,14 @@ sub new($) {
foreach my $name (split(/\s+/, $headers)) { foreach my $name (split(/\s+/, $headers)) {
$$conditional_headers{$name}++; $$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*([^,\)]*)(?:,|\))?/) { } elsif(/AC_CHECK_FUNCS\(\s*([^,\)]*)(?:,|\))?/) {
my $funcs = $1; my $funcs = $1;
$funcs =~ s/^\s*\[\s*(.*?)\s*\]\s*$/$1/; $funcs =~ s/^\s*\[\s*(.*?)\s*\]\s*$/$1/;
......
...@@ -583,8 +583,7 @@ foreach my $file (@c_files) { ...@@ -583,8 +583,7 @@ foreach my $file (@c_files) {
} }
} }
} elsif($preprocessor->is_def($macro)) { } elsif($preprocessor->is_def($macro)) {
$output->write("$file: #$directive $argument: is protected, " . $output->write("$file: #$directive $argument: is protected, but there is no check for it in configure.ac\n");
"but is not a conditional include\n");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment