[droid] Support building for android
authorCory Fields <theuni-nospam-@xbmc.org>
Wed, 28 Nov 2012 17:04:05 +0000 (12:04 -0500)
committerCory Fields <theuni-nospam-@xbmc.org>
Wed, 28 Nov 2012 17:04:10 +0000 (12:04 -0500)
These are the changes necessary to build for android. Working status is yet
untested.

include/libnfs.h
lib/libnfs-sync.c
lib/libnfs.c
nfs/libnfs-raw-nfs.h
nlm/libnfs-raw-nlm.h

index ab2b583dea940a5e12b46ab14840c2bd9b040c9b..75613d701bf67b034c563d0c1f7cce0ecc310e74 100644 (file)
@@ -18,6 +18,9 @@
  * This is the highlevel interface to access NFS resources using a posix-like interface
  */
 #include <stdint.h>
+#if defined(ANDROID)
+#include <sys/time.h>
+#endif
 
 struct nfs_context;
 struct rpc_context;
index 4e671cb98351244e9021a6661a0b800362353a1a..fd6f796e3f830a869fc0b6c8f849e4de1e8a7a57 100644 (file)
 #else
 #include <strings.h>
 #include <unistd.h>
+#ifndef ANDROID
 #include <sys/statvfs.h>
+#else
+#include <netinet/in.h>
+#include <sys/vfs.h>
+#define statvfs statfs
+#endif
 #include <poll.h>
 #include <sys/ioctl.h>
 #include <netdb.h>
index e68468bf79d2bfe10e083ef237cf955f2304de3f..deab4f1c1036ef1e1584ea904d3f2cd28214c6a3 100644 (file)
 #define DllExport
 #else
 #include <strings.h>
+#ifndef ANDROID
 #include <sys/statvfs.h>
+#else
+#include <sys/vfs.h>
+#define statvfs statfs
+#endif
 #include <utime.h>
 #include <unistd.h>
 #endif/*WIN32*/
@@ -2414,10 +2419,12 @@ static void nfs_statvfs_1_cb(struct rpc_context *rpc, int status, void *command_
        svfs.f_bavail  = res->FSSTAT3res_u.resok.abytes/4096;
        svfs.f_files   = res->FSSTAT3res_u.resok.tfiles;
        svfs.f_ffree   = res->FSSTAT3res_u.resok.ffiles;
+#if !defined(ANDROID)
        svfs.f_favail  = res->FSSTAT3res_u.resok.afiles;
        svfs.f_fsid    = 0;
        svfs.f_flag    = 0;
        svfs.f_namemax = 256;
+#endif
 
        data->cb(0, nfs, &svfs, data->private_data);
        free_nfs_cb_data(data);
index c2c2f9a0362ec180b83877056e96257df9223e60..4ba504fdf0cf46b2c314c85e8c2aa3b6a5031116 100644 (file)
@@ -18,6 +18,11 @@ extern "C" {
 #define NFS3_CREATEVERFSIZE 8
 #define NFS3_COOKIEVERFSIZE 8
 
+#if defined(ANDROID)
+typedef long long int quad_t;
+typedef long long unsigned u_quad_t;
+#endif
+
 typedef char cookieverf3[NFS3_COOKIEVERFSIZE];
 
 typedef u_quad_t uint64;
index b50e93406d6be1334e831eb1c3a7ac26ffd7ae79..ca4dbe2a1512cc7ceead25eb84491f77ebe10c36 100644 (file)
 extern "C" {
 #endif
 
+#if defined(ANDROID)
+typedef long long int quad_t;
+typedef long long unsigned u_quad_t;
+#endif
 
 struct nlm_fh4 {
        struct {