more include cleanups it starts to look almost decent now
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 14 Apr 2013 17:32:01 +0000 (10:32 -0700)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 14 Apr 2013 17:32:01 +0000 (10:32 -0700)
configure.ac
examples/nfsclient-listservers.c
examples/nfsclient-sync.c
lib/init.c
lib/libnfs-sync.c
lib/libnfs.c
lib/pdu.c

index 70e451b0c8fc4f63c5578b036a73623d05a20622..8141179635f925c98243306f54437bc3e423d8a0 100644 (file)
@@ -93,6 +93,14 @@ AC_CHECK_HEADERS([unistd.h])
 dnl Check for sys/ioctl.h
 AC_CHECK_HEADERS([sys/ioctl.h])
 
+# check for sys/vfs.h
+dnl Check for sys/vfs.h
+AC_CHECK_HEADERS([sys/vfs.h])
+
+# check for sys/statvfs.h
+dnl Check for sys/statvfs.h
+AC_CHECK_HEADERS([sys/statvfs.h])
+
 # check for SA_LEN
 dnl Check if sockaddr data structure includes a "sa_len"
 AC_CHECK_MEMBER([struct sockaddr.sa_len],
index 9bec6a75c819c6c8c40057f88ce4f87a094b6447..db71520de7d1ccd27b97e983138e6763ee5f948c 100644 (file)
 
 /* Example program showing sync interface to probe for all local servers
  */
+#ifdef AROS
+#include "aros_compat.h"
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #include "libnfs-zdr.h"
 #include "libnfs.h"
 
-#ifdef AROS
-#include "aros_compat.h"
-#endif
-
 int main(int argc _U_, char *argv[] _U_)
 {
        struct nfs_server_list *srvrs;
index 70bd77a1757c18dca5cd536871afc7a8380f1bf5..72aa312fe2b6625e034894327bcffbe019fdbb74 100644 (file)
 #include "config.h"
 #endif
 
+#ifdef AROS
+#include "aros_compat.h"
+#endif
 #ifdef WIN32
 #include "win32_compat.h"
 #pragma comment(lib, "ws2_32.lib")
@@ -40,10 +44,6 @@ WSADATA wsaData;
 #include <unistd.h>
 #endif
 
-#ifdef AROS
-#include "aros_compat.h"
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
index 6085b6892bb9cc068f8611aa90113a5ec1b5f910..ecac1e7e2fd168b3831aea109a32d65ad093cb20 100644 (file)
 #include "config.h"
 #endif
 
+#ifdef AROS
+#include "aros_compat.h"
+#endif
+
 #ifdef WIN32
 #include "win32_compat.h"
 #else
 #include "libnfs-raw.h"
 #include "libnfs-private.h"
 
-#ifdef AROS
-#include "aros_compat.h"
-#endif
-
 struct rpc_context *rpc_init_context(void)
 {
        struct rpc_context *rpc;
index f2c9ebf481387dd8cdd2c39dde00347f58dae8c2..0527bbf7ff752498418bc4863a890a0713ed638d 100644 (file)
 #include "config.h"
 #endif
 
+#ifdef AROS
+#include "aros_compat.h"
+#endif
+
 #ifdef WIN32
 #include "win32_compat.h"
 #else
 #include <netdb.h>
 #include <sys/socket.h>
 #include <net/if.h>
+#endif /*WIN32*/
 
-#ifdef AROS
-#include "aros_compat.h"
-#else
 #ifdef ANDROID
 #include <netinet/in.h>
-#include <sys/vfs.h>
 #define statvfs statfs
-#else
+#endif
+
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+
+#ifdef HAVE_SYS_STATVFS_H
 #include <sys/statvfs.h>
-#endif /*ANDRIOD*/
-#endif /*AROS*/
-#endif /*WIN32*/
+#endif
 
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
index c3df1df813dd8fa13e42c41cec90b2c14d8e3535..c07a8e84b60eb7085ec655d789d4eea8badd54ef 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#ifdef AROS
+#include "aros_compat.h"
 #endif
 
 #ifdef WIN32
 #include "win32_compat.h"
 #else
-
 #include <strings.h>
 #include <utime.h>
+#endif /*WIN32*/
 
-#ifdef AROS
-#include "aros_compat.h"
-#else
 #ifdef ANDROID
-#include <sys/vfs.h>
 #define statvfs statfs
-#else
-#include <sys/statvfs.h>
-#endif /*ANDROID*/
-#endif /*AROS*/
-#endif /*WIN32*/
+#endif
 
 #define _GNU_SOURCE
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
index e4f296b5eed70d71846b95adff94dfbeaee55c2f..5dff51780d6b2edfe21ec5c03265c8515c810e07 100644 (file)
--- a/lib/pdu.c
+++ b/lib/pdu.c
    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
+#ifdef AROS
+#include "aros_compat.h"
+#endif
+
 #ifdef WIN32
 #include "win32_compat.h"
 #else
 #include "libnfs-raw.h"
 #include "libnfs-private.h"
 
-#ifdef AROS
-#include "aros_compat.h"
-#endif
-
 struct rpc_pdu *rpc_allocate_pdu(struct rpc_context *rpc, int program, int version, int procedure, rpc_cb cb, void *private_data, zdrproc_t zdr_decode_fn, int zdr_decode_bufsize)
 {
        struct rpc_pdu *pdu;