summaryrefslogtreecommitdiff
path: root/include/rpc/xdr.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-23 23:22:10 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-23 23:22:10 +0000
commitcc479c5abf86e0014cf6bc3492bbf53a47f503fc (patch)
treef6d242ea42993b010612c28cfcbc5228cee94549 /include/rpc/xdr.h
parenta1d98e054e1d2a3481f897fb40f98972a57c74d9 (diff)
sync with glibc
Diffstat (limited to 'include/rpc/xdr.h')
-rw-r--r--include/rpc/xdr.h34
1 files changed, 11 insertions, 23 deletions
diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 4b2bb0e97..d2d097c86 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -39,13 +39,13 @@
#ifdef _LIBC
/* Some adjustments to make the libc source from glibc
* compile more easily with uClibc... */
-#ifndef __FORCE_GLIBC
-#define __FORCE_GLIBC
-#endif
-#ifndef _GNU_SOUCE
-#define _GNU_SOUCE
-#endif
-#define _(X) X
+# ifndef __FORCE_GLIBC
+# define __FORCE_GLIBC
+# endif
+# ifndef _GNU_SOUCE
+# define _GNU_SOUCE
+# endif
+# define _(X) X
#endif
#include <features.h>
#include <sys/types.h>
@@ -137,7 +137,7 @@ struct XDR
/* returns bytes off from beginning */
bool_t (*x_setpostn) (XDR *__xdrs, u_int __pos);
/* lets you reposition the stream */
- int32_t *(*x_inline) (XDR *__xdrs, int __len);
+ int32_t *(*x_inline) (XDR *__xdrs, u_int __len);
/* buf quick ptr to buffered data */
void (*x_destroy) (XDR *__xdrs);
/* free privates of this xdr_stream */
@@ -150,7 +150,7 @@ struct XDR
caddr_t x_public; /* users' data */
caddr_t x_private; /* pointer to private data */
caddr_t x_base; /* private used for position info */
- int x_handy; /* extra private word */
+ u_int x_handy; /* extra private word */
};
/*
@@ -273,20 +273,8 @@ struct xdr_discrim
* and shouldn't be used any longer. Code which use this defines or longs
* in the RPC code will not work on 64bit Solaris platforms !
*/
-/* #define IXDR_GET_LONG(buf) \ */
-/* ((long)ntohl((u_long)*(*(u_int32_t**)&(buf))++)) */
-/* #define IXDR_PUT_LONG(buf, v) \ */
-/* (*(*(u_int32_t**)&(buf))++ = (long)htonl((u_long)(v))) */
-
-/* WARNING: These macros are not safe against side effects for the 'buf'
- * argument. But the old versions they're replacing took the address of
- * 'buf' and were probably not safe in that situation either. */
-#define IXDR_GET_LONG(buf) \
- ((long) ntohl((u_long) (((u_int32_t *)(buf = (void *)(((char *) buf) + sizeof(u_int32_t))))[-1]) ))
-#define IXDR_PUT_LONG(buf, v) \
- (((u_int32_t *)(buf = (void *)(((char *) buf) + sizeof(u_int32_t))))[-1]) = (long)htonl((u_long)(v))
-
-
+#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
+#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))