configure: For sys/mount.h, sys/statfs.h and sys/vfs.h, always include
them if present.
diff --git a/configure b/configure
index 0e04c81..1322de9 100755
--- a/configure
+++ b/configure
@@ -16202,231 +16202,6 @@
 fi
 
 
-if test "$ac_cv_header_sys_vfs_h" = "yes"
-then
-    echo "$as_me:$LINENO: checking whether sys/vfs.h defines statfs" >&5
-echo $ECHO_N "checking whether sys/vfs.h defines statfs... $ECHO_C" >&6
-if test "${wine_cv_sys_vfs_has_statfs+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-	#include <sys/types.h>
-	#ifdef HAVE_SYS_PARAM_H
-	# include <sys/param.h>
-	#endif
-	#include <sys/vfs.h>
-
-int
-main ()
-{
-
-		struct statfs stfs;
-
-		memset(&stfs,0,sizeof(stfs));
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  wine_cv_sys_vfs_has_statfs=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-wine_cv_sys_vfs_has_statfs=no
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $wine_cv_sys_vfs_has_statfs" >&5
-echo "${ECHO_T}$wine_cv_sys_vfs_has_statfs" >&6
-    if test "$wine_cv_sys_vfs_has_statfs" = "yes"
-    then
-
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_DEFINED_BY_SYS_VFS 1
-_ACEOF
-
-    fi
-fi
-
-if test "$ac_cv_header_sys_statfs_h" = "yes"
-then
-    echo "$as_me:$LINENO: checking whether sys/statfs.h defines statfs" >&5
-echo $ECHO_N "checking whether sys/statfs.h defines statfs... $ECHO_C" >&6
-if test "${wine_cv_sys_statfs_has_statfs+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-	#include <sys/types.h>
-	#ifdef HAVE_SYS_PARAM_H
-	# include <sys/param.h>
-	#endif
-	#include <sys/statfs.h>
-
-int
-main ()
-{
-
-		struct statfs stfs;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  wine_cv_sys_statfs_has_statfs=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-wine_cv_sys_statfs_has_statfs=no
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $wine_cv_sys_statfs_has_statfs" >&5
-echo "${ECHO_T}$wine_cv_sys_statfs_has_statfs" >&6
-    if test "$wine_cv_sys_statfs_has_statfs" = "yes"
-    then
-
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_DEFINED_BY_SYS_STATFS 1
-_ACEOF
-
-    fi
-fi
-
-if test "$ac_cv_header_sys_mount_h" = "yes"
-then
-    echo "$as_me:$LINENO: checking whether sys/mount.h defines statfs" >&5
-echo $ECHO_N "checking whether sys/mount.h defines statfs... $ECHO_C" >&6
-if test "${wine_cv_sys_mount_has_statfs+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-	#include <sys/types.h>
-	#ifdef HAVE_SYS_PARAM_H
-	# include <sys/param.h>
-	#endif
-	#include <sys/mount.h>
-
-int
-main ()
-{
-
-		struct statfs stfs;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  wine_cv_sys_mount_has_statfs=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-wine_cv_sys_mount_has_statfs=no
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $wine_cv_sys_mount_has_statfs" >&5
-echo "${ECHO_T}$wine_cv_sys_mount_has_statfs" >&6
-    if test "$wine_cv_sys_mount_has_statfs" = "yes"
-    then
-
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_DEFINED_BY_SYS_MOUNT 1
-_ACEOF
-
-    fi
-fi
-
-
 echo "$as_me:$LINENO: checking for struct statfs.f_bfree" >&5
 echo $ECHO_N "checking for struct statfs.f_bfree... $ECHO_C" >&6
 if test "${ac_cv_member_struct_statfs_f_bfree+set}" = set; then
@@ -16442,16 +16217,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16500,16 +16273,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16579,16 +16350,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16637,16 +16406,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16716,16 +16483,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16774,16 +16539,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16853,16 +16616,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16911,16 +16672,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -16990,16 +16749,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -17048,16 +16805,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -17127,16 +16882,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
@@ -17185,16 +16938,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int
diff --git a/configure.ac b/configure.ac
index d808c88..5786a92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1312,76 +1312,6 @@
    fi
 fi
 
-dnl **** statfs checks ****
-
-if test "$ac_cv_header_sys_vfs_h" = "yes"
-then
-    AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
-		    wine_cv_sys_vfs_has_statfs,
-	AC_TRY_COMPILE([
-	#include <sys/types.h>
-	#ifdef HAVE_SYS_PARAM_H
-	# include <sys/param.h>
-	#endif
-	#include <sys/vfs.h>
-	],[
-		struct statfs stfs;
-
-		memset(&stfs,0,sizeof(stfs));
-	],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
-	)
-    )
-    if test "$wine_cv_sys_vfs_has_statfs" = "yes"
-    then
-      AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
-                [Define if the struct statfs is defined by <sys/vfs.h>])
-    fi
-fi
-
-if test "$ac_cv_header_sys_statfs_h" = "yes"
-then
-    AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
-		    wine_cv_sys_statfs_has_statfs,
-	AC_TRY_COMPILE([
-	#include <sys/types.h>
-	#ifdef HAVE_SYS_PARAM_H
-	# include <sys/param.h>
-	#endif
-	#include <sys/statfs.h>
-	],[
-		struct statfs stfs;
-	],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
-	)
-    )
-    if test "$wine_cv_sys_statfs_has_statfs" = "yes"
-    then
-      AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
-                [Define if the struct statfs is defined by <sys/statfs.h>])
-    fi
-fi
-
-if test "$ac_cv_header_sys_mount_h" = "yes"
-then
-    AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
-		    wine_cv_sys_mount_has_statfs,
-	AC_TRY_COMPILE([
-	#include <sys/types.h>
-	#ifdef HAVE_SYS_PARAM_H
-	# include <sys/param.h>
-	#endif
-	#include <sys/mount.h>
-	],[
-		struct statfs stfs;
-	],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
-	)
-    )
-    if test "$wine_cv_sys_mount_has_statfs" = "yes"
-    then
-      AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
-                [Define if the struct statfs is defined by <sys/mount.h>])
-    fi
-fi
-
 dnl **** FIXME: what about mixed cases, where we need two of them? ***
 
 dnl Check for statfs members
@@ -1390,16 +1320,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_MOUNT
+#ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_VFS
-#  include <sys/vfs.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif])
 
 AC_CHECK_MEMBERS([struct statvfs.f_blocks],,,
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 2293800..bbeb27f 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -45,16 +45,14 @@
 #ifdef HAVE_UTIME_H
 # include <utime.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_VFS
+#ifdef HAVE_SYS_VFS_H
 # include <sys/vfs.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_MOUNT
-#  include <sys/mount.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 #ifdef HAVE_IOKIT_IOKITLIB_H
diff --git a/include/config.h.in b/include/config.h.in
index 644f280..c937226 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -968,15 +968,6 @@
 /* Define to the soname of the libXrender library. */
 #undef SONAME_LIBXRENDER
 
-/* Define if the struct statfs is defined by <sys/mount.h> */
-#undef STATFS_DEFINED_BY_SYS_MOUNT
-
-/* Define if the struct statfs is defined by <sys/statfs.h> */
-#undef STATFS_DEFINED_BY_SYS_STATFS
-
-/* Define if the struct statfs is defined by <sys/vfs.h> */
-#undef STATFS_DEFINED_BY_SYS_VFS
-
 /* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
 #undef STAT_MACROS_BROKEN
 
diff --git a/libs/port/fstatvfs.c b/libs/port/fstatvfs.c
index a6ba691..47e655d 100644
--- a/libs/port/fstatvfs.c
+++ b/libs/port/fstatvfs.c
@@ -29,16 +29,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_VFS
+#ifdef HAVE_SYS_VFS_H
 # include <sys/vfs.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_MOUNT
-#  include <sys/mount.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int fstatvfs( int fd, struct statvfs *buf )
diff --git a/libs/port/statvfs.c b/libs/port/statvfs.c
index 9d67211..a67accd 100644
--- a/libs/port/statvfs.c
+++ b/libs/port/statvfs.c
@@ -29,16 +29,14 @@
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
-#ifdef STATFS_DEFINED_BY_SYS_VFS
+#ifdef HAVE_SYS_VFS_H
 # include <sys/vfs.h>
-#else
-# ifdef STATFS_DEFINED_BY_SYS_MOUNT
-#  include <sys/mount.h>
-# else
-#  ifdef STATFS_DEFINED_BY_SYS_STATFS
-#   include <sys/statfs.h>
-#  endif
-# endif
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
 int statvfs( const char *path, struct statvfs *buf )
diff --git a/tools/winapi/winapi_check b/tools/winapi/winapi_check
index 1ef85dd..183b13b 100755
--- a/tools/winapi/winapi_check
+++ b/tools/winapi/winapi_check
@@ -581,8 +581,7 @@
 			    } elsif($macro =~ /^HAVE_(.*?)_H$/) {
 				my $name = $1;
 				if($header !~ /^alloca\.h$/ &&
-				   $file_dir !~ /tests$/ &&
-				   !$preprocessor->is_def("STATFS_DEFINED_BY_$name"))
+				   $file_dir !~ /tests$/)
 				{
 				    $output->write("$file: #$directive $argument: is a conditional include, " .
 						   "but is not protected\n");