From cd954dd55eb47d88145393e0b3ba20bfd85a52a5 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 24 Dec 2013 08:34:38 -0800 Subject: [PATCH] NFS: Update compile_rpc and regenerate the nfs marshalling/unmarshalling code We had some manual changes to the nfs code to handle ANDROID and WIN32. Update the rpc generation target to add these extra define. --- nfs/Makefile.am | 2 +- nfs/libnfs-raw-nfs.c | 2 +- nfs/libnfs-raw-nfs.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nfs/Makefile.am b/nfs/Makefile.am index d6f75a0..82e60c5 100644 --- a/nfs/Makefile.am +++ b/nfs/Makefile.am @@ -18,5 +18,5 @@ nfs-stamp : nfs.x touch nfs-stamp compile_rpc: - rpcgen -h nfs.x | sed -e "s/#include //" | sed -e "s/xdr/zdr/g" -e "s/XDR/ZDR/g" > libnfs-raw-nfs.h + rpcgen -h nfs.x | sed -e "s/#include //" -e "s/xdr/zdr/g" -e "s/XDR/ZDR/g" -e "s/#define _NFS_H_RPCGEN/#define _NFS_H_RPCGEN\n#include /g" -e "s/#define NFS3_COOKIEVERFSIZE 8/#define NFS3_COOKIEVERFSIZE 8\n\n#if defined(ANDROID)\ntypedef long long int quad_t;\ntypedef long long unsigned u_quad_t;\n#endif\n#if defined(WIN32)\ntypedef long long int quad_t;\ntypedef long long unsigned u_quad_t;\n#endif/g" > libnfs-raw-nfs.h rpcgen -c nfs.x | sed -e "s/#include \".*nfs.h\"/#include \"libnfs-xdr.h\"\n#include \"libnfs-raw-nfs.h\"/" -e "s/xdr/zdr/g" -e "s/XDR/ZDR/g" -e "s/register int32_t \*buf;/register int32_t *buf;\n buf = NULL;/" > libnfs-raw-nfs.c diff --git a/nfs/libnfs-raw-nfs.c b/nfs/libnfs-raw-nfs.c index ab3c4f7..ce319ec 100644 --- a/nfs/libnfs-raw-nfs.c +++ b/nfs/libnfs-raw-nfs.c @@ -628,7 +628,7 @@ zdr_set_mode3 (ZDR *zdrs, set_mode3 *objp) register int32_t *buf; buf = NULL; - if (!zdr_bool (zdrs, &objp->set_it)) + if (!zdr_bool (zdrs, &objp->set_it)) return FALSE; switch (objp->set_it) { case TRUE: diff --git a/nfs/libnfs-raw-nfs.h b/nfs/libnfs-raw-nfs.h index dc47c05..fa87089 100644 --- a/nfs/libnfs-raw-nfs.h +++ b/nfs/libnfs-raw-nfs.h @@ -5,9 +5,11 @@ #ifndef _NFS_H_RPCGEN #define _NFS_H_RPCGEN - #include + + + #ifdef __cplusplus extern "C" { #endif -- 2.34.1