From: Cory Fields Date: Wed, 28 Nov 2012 17:04:05 +0000 (-0500) Subject: [droid] Support building for android X-Git-Tag: upstream/1.9.6^2~240^2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=252aa90dc87de7a4f6cdaff5a71edc74b9f8bad1;p=deb_libnfs.git [droid] Support building for android These are the changes necessary to build for android. Working status is yet untested. --- diff --git a/include/libnfs.h b/include/libnfs.h index ab2b583..75613d7 100644 --- a/include/libnfs.h +++ b/include/libnfs.h @@ -18,6 +18,9 @@ * This is the highlevel interface to access NFS resources using a posix-like interface */ #include +#if defined(ANDROID) +#include +#endif struct nfs_context; struct rpc_context; diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 4e671cb..fd6f796 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -23,7 +23,13 @@ #else #include #include +#ifndef ANDROID #include +#else +#include +#include +#define statvfs statfs +#endif #include #include #include diff --git a/lib/libnfs.c b/lib/libnfs.c index e68468b..deab4f1 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -22,7 +22,12 @@ #define DllExport #else #include +#ifndef ANDROID #include +#else +#include +#define statvfs statfs +#endif #include #include #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); diff --git a/nfs/libnfs-raw-nfs.h b/nfs/libnfs-raw-nfs.h index c2c2f9a..4ba504f 100644 --- a/nfs/libnfs-raw-nfs.h +++ b/nfs/libnfs-raw-nfs.h @@ -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; diff --git a/nlm/libnfs-raw-nlm.h b/nlm/libnfs-raw-nlm.h index b50e934..ca4dbe2 100644 --- a/nlm/libnfs-raw-nlm.h +++ b/nlm/libnfs-raw-nlm.h @@ -13,6 +13,10 @@ extern "C" { #endif +#if defined(ANDROID) +typedef long long int quad_t; +typedef long long unsigned u_quad_t; +#endif struct nlm_fh4 { struct {