diff --git a/dlls/crtdll/crtdll_main.c b/dlls/crtdll/crtdll_main.c index 10c1e1cc164..372a7dc338b 100644 --- a/dlls/crtdll/crtdll_main.c +++ b/dlls/crtdll/crtdll_main.c @@ -21,7 +21,9 @@ #include "config.h" #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include "windef.h" #include "winbase.h" diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 4ce18265a6d..a272b0aba1a 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -24,7 +24,9 @@ #include #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #ifdef HAVE_SYS_MMAN_H #include diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index 0371c91362f..93843a78f69 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -33,7 +33,9 @@ #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_SYS_MMAN_H #include #endif diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index 1d0f2ea3354..3bedcc1e62d 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c @@ -25,7 +25,9 @@ #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #include #include diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index 437e86472aa..5f6dbd35b4a 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -65,7 +65,9 @@ #endif #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_SYS_FILIO_H # include #endif diff --git a/dlls/kernel/kernel_main.c b/dlls/kernel/kernel_main.c index 1fc46732ce0..92ba48b2d35 100644 --- a/dlls/kernel/kernel_main.c +++ b/dlls/kernel/kernel_main.c @@ -25,7 +25,9 @@ #include #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #include "windef.h" diff --git a/dlls/kernel/oldconfig.c b/dlls/kernel/oldconfig.c index 7c18274e42e..7f72a149a8a 100644 --- a/dlls/kernel/oldconfig.c +++ b/dlls/kernel/oldconfig.c @@ -27,7 +27,9 @@ #include #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #ifdef HAVE_SYS_IOCTL_H #include diff --git a/dlls/kernel/vxd.c b/dlls/kernel/vxd.c index ecd5bd04eb8..91808968c1a 100644 --- a/dlls/kernel/vxd.c +++ b/dlls/kernel/vxd.c @@ -28,7 +28,9 @@ # include #endif #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #include diff --git a/dlls/msacm/winemp3/common.c b/dlls/msacm/winemp3/common.c index 57e1c738240..6b541fe4f46 100644 --- a/dlls/msacm/winemp3/common.c +++ b/dlls/msacm/winemp3/common.c @@ -16,12 +16,15 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" #include #include #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #include "mpg123.h" diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c index ca054d4a595..42699829f18 100644 --- a/dlls/ntdll/cdrom.c +++ b/dlls/ntdll/cdrom.c @@ -34,7 +34,9 @@ # include #endif #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #ifdef HAVE_SYS_IOCTL_H diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index df7cc74061a..f4b8586ce75 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -34,7 +34,9 @@ #ifdef HAVE_MNTENT_H #include #endif -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_SYS_IOCTL_H #include #endif diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index aca396acf05..5fe96ba323f 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -23,7 +23,9 @@ #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include "windef.h" #include "winbase.h" diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 608c16d673f..b0f098b3b1b 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -43,7 +43,9 @@ #ifdef HAVE_SYS_MMAN_H #include #endif -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_SYS_UIO_H #include #endif diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 2d2d83f0818..a5450fe921b 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -18,12 +18,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" #include #include #include #include -#include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_PWD_H +# include +#endif #include #define COBJMACROS diff --git a/dlls/winaspi/winaspi16.c b/dlls/winaspi/winaspi16.c index 19b387290a5..d7528eacc62 100644 --- a/dlls/winaspi/winaspi16.c +++ b/dlls/winaspi/winaspi16.c @@ -23,7 +23,6 @@ #include #include #include -#include #ifdef HAVE_UNISTD_H # include #endif diff --git a/dlls/winaspi/winaspi32.c b/dlls/winaspi/winaspi32.c index d1594d27451..0e975d9ad72 100644 --- a/dlls/winaspi/winaspi32.c +++ b/dlls/winaspi/winaspi32.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #ifdef HAVE_UNISTD_H # include #endif diff --git a/dlls/winedos/int21.c b/dlls/winedos/int21.c index 8b53ece107e..d1abc16e39c 100644 --- a/dlls/winedos/int21.c +++ b/dlls/winedos/int21.c @@ -28,7 +28,9 @@ #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif diff --git a/dlls/winedos/module.c b/dlls/winedos/module.c index 4d2097170cd..50a989546af 100644 --- a/dlls/winedos/module.c +++ b/dlls/winedos/module.c @@ -33,7 +33,9 @@ # include #endif #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_SYS_TIME_H # include #endif diff --git a/dlls/winedos/ppdev.c b/dlls/winedos/ppdev.c index ee3b4f4264c..7b0c9cef3ac 100644 --- a/dlls/winedos/ppdev.c +++ b/dlls/winedos/ppdev.c @@ -27,7 +27,9 @@ #include #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #include #ifdef HAVE_SYS_IOCTL_H diff --git a/dlls/winedos/vxd.c b/dlls/winedos/vxd.c index bbd09a4546c..b251e1caf78 100644 --- a/dlls/winedos/vxd.c +++ b/dlls/winedos/vxd.c @@ -22,7 +22,7 @@ #include "wine/port.h" #include -#include +#include #include #include #include diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c index 2a974c30aba..3c974c694da 100644 --- a/dlls/winsock/socket.c +++ b/dlls/winsock/socket.c @@ -99,7 +99,9 @@ # define HAVE_IPX #endif #ifdef HAVE_IPX_LINUX -# include +# ifdef HAVE_ASM_TYPES_H +# include +# endif # include # define HAVE_IPX #endif diff --git a/loader/preloader.c b/loader/preloader.c index a10558bc929..cb974ff375f 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -68,7 +68,9 @@ #include #include #include -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #include #ifdef HAVE_SYS_MMAN_H # include diff --git a/tools/winapi/nativeapi.pm b/tools/winapi/nativeapi.pm index 094ff05a1cf..81bf88ffc34 100644 --- a/tools/winapi/nativeapi.pm +++ b/tools/winapi/nativeapi.pm @@ -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/; diff --git a/tools/winapi/winapi_check b/tools/winapi/winapi_check index e6773dc811e..eac3062880b 100755 --- a/tools/winapi/winapi_check +++ b/tools/winapi/winapi_check @@ -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"); } }