Bug 784124 - Properly check for stat(v)fs, only used by XPCOM implementation. r=bsmedberg
authorJan Beich <jbeich@tormail.org>
Wed, 29 Aug 2012 17:00:10 -0400
changeset 103817 1ffa5cb41f5453e19ef54d4baaef56bd07e23ffe
parent 103816 cbeea411b904c7934094cc28625c49d38d260536
child 103818 fffa907d23a656a3ea157799fc9fe197c3252fc0
push id14182
push userryanvm@gmail.com
push dateWed, 29 Aug 2012 21:00:14 +0000
treeherdermozilla-inbound@acb866bc42c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs784124
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 784124 - Properly check for stat(v)fs, only used by XPCOM implementation. r=bsmedberg
configure.in
xpcom/io/nsLocalFileUnix.cpp
xpcom/io/nsLocalFileUnix.h
xpcom/xpcom-config.h.in
xpcom/xpcom-private.h.in
--- a/configure.in
+++ b/configure.in
@@ -3210,17 +3210,18 @@ then
     LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
 fi
 
 
 dnl Checks for library functions.
 dnl ========================================================
 AC_PROG_GCC_TRADITIONAL
 AC_FUNC_MEMCMP
-AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
+AC_CHECK_FUNCS(random strerror lchown fchmod snprintf memmove rint stat64 lstat64 truncate64 setbuf isatty)
+AC_CHECK_FUNCS(statvfs64 statvfs statfs64 statfs)
 AC_CHECK_FUNCS(flockfile getpagesize)
 AC_CHECK_FUNCS(localtime_r strtok_r)
 
 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
                ac_cv_clock_monotonic,
                [for libs in "" -lrt; do
                     _SAVE_LIBS="$LIBS"
@@ -8595,27 +8596,31 @@ dnl The following defines are used by xp
 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
 CPP_THROW_NEW
 HAVE_CPP_2BYTE_WCHAR_T
 HAVE_CPP_AMBIGUITY_RESOLVING_USING
 HAVE_CPP_CHAR16_T
 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
 HAVE_CPP_PARTIAL_SPECIALIZATION
 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
-HAVE_STATVFS
-HAVE_STATVFS64
 NEED_CPP_UNUSED_IMPLEMENTATIONS
 NEW_H
 HAVE_GETPAGESIZE
 HAVE_ICONV
 HAVE_ICONV_WITH_CONST_INPUT
 HAVE_MBRTOWC
-HAVE_SYS_MOUNT_H
+HAVE_WCRTOMB
+HAVE_STATVFS64
+HAVE_STATVFS
+HAVE_STATFS64
+HAVE_STATFS
+HAVE_SYS_STATVFS_H
+HAVE_SYS_STATFS_H
 HAVE_SYS_VFS_H
-HAVE_WCRTOMB
+HAVE_SYS_MOUNT_H
 "
 
 AC_CONFIG_HEADER(
 netwerk/necko-config.h
 xpcom/xpcom-config.h
 xpcom/xpcom-private.h
 )
 
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -31,16 +31,17 @@
 #if (MOZ_PLATFORM_MAEMO == 6)
 #include <QUrl>
 #include <QString>
 #if (MOZ_ENABLE_CONTENTACTION)
 #include <contentaction/contentaction.h>
 #endif
 #endif
 
+#include "xpcom-private.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsCRT.h"
 #include "nsCOMPtr.h"
 #include "nsMemory.h"
 #include "nsIFile.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsLocalFile.h"
--- a/xpcom/io/nsLocalFileUnix.h
+++ b/xpcom/io/nsLocalFileUnix.h
@@ -33,16 +33,25 @@
     #endif
     #include <sys/statvfs.h>
 #endif
 
 #ifdef HAVE_SYS_STATFS_H
     #include <sys/statfs.h>
 #endif
 
+#ifdef HAVE_SYS_VFS_H
+    #include <sys/vfs.h>
+#endif
+
+#ifdef HAVE_SYS_MOUNT_H
+    #include <sys/param.h>
+    #include <sys/mount.h>
+#endif
+
 #if defined(XP_MACOSX) && (defined(HAVE_STATVFS64) || !defined(HAVE_STATVFS))
 #error "Double-check which members of the 'STATFS' struct we're using!"
 #endif
 
 #ifdef HAVE_STATVFS64
     #define STATFS statvfs64
 #else
     #ifdef HAVE_STATVFS
--- a/xpcom/xpcom-config.h.in
+++ b/xpcom/xpcom-config.h.in
@@ -27,19 +27,16 @@
 /* Define if the c++ compiler supports partial template specialization */
 #undef HAVE_CPP_PARTIAL_SPECIALIZATION
 
 /* Define if the c++ compiler has trouble comparing a constant
  * reference to a templatized class to zero
  */
 #undef HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
 
-/* Define if statvfs() is available */
-#undef HAVE_STATVFS
-
 /* Define if the c++ compiler requires implementations of 
  * unused virtual methods
  */
 #undef NEED_CPP_UNUSED_IMPLEMENTATIONS
 
 /* Define to either <new> or <new.h> */
 #undef NEW_H
 
--- a/xpcom/xpcom-private.h.in
+++ b/xpcom/xpcom-private.h.in
@@ -14,19 +14,37 @@
 #undef HAVE_ICONV
 
 /* Define if iconv() supports const input */
 #undef HAVE_ICONV_WITH_CONST_INPUT
 
 /* Define if mbrtowc() is available */
 #undef HAVE_MBRTOWC
 
-/* Define if <sys/mount.h> is present */
-#undef HAVE_SYS_MOUNT_H
+/* Define if wcrtomb() is available */
+#undef HAVE_WCRTOMB
+
+/* Define if statvfs64() is available */
+#undef HAVE_STATVFS64
+
+/* Define if statvfs() is available */
+#undef HAVE_STATVFS
+
+/* Define if statfs64() is available */
+#undef HAVE_STATFS64
+
+/* Define if statfs() is available */
+#undef HAVE_STATFS
+
+/* Define if <sys/statvfs.h> is present */
+#undef HAVE_SYS_STATVFS_H
+
+/* Define if <sys/statfs.h> is present */
+#undef HAVE_SYS_STATFS_H
 
 /* Define if <sys/vfs.h> is present */
 #undef HAVE_SYS_VFS_H
 
-/* Define if wcrtomb() is available */
-#undef HAVE_WCRTOMB
+/* Define if <sys/mount.h> is present */
+#undef HAVE_SYS_MOUNT_H
 
 #endif /* _XPCOM_PRIVATE_H_ */