From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 30 20:30:09 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77DC31065673 for ; Thu, 30 Aug 2012 20:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 589A18FC08 for ; Thu, 30 Aug 2012 20:30:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7UKU9Qo056575 for ; Thu, 30 Aug 2012 20:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7UKU9PB056572; Thu, 30 Aug 2012 20:30:09 GMT (envelope-from gnats) Date: Thu, 30 Aug 2012 20:30:09 GMT Message-Id: <201208302030.q7UKU9PB056572@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Pedro Giffuni Cc: Subject: Re: kern/137443: [headers] Including /usr/include/rpc/xdr.h fails with C++ X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pedro Giffuni List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:30:09 -0000 The following reply was made to PR kern/137443; it has been noted by GNATS. From: Pedro Giffuni To: bug-followup@FreeBSD.org, stast@bsdportal.ru Cc: Subject: Re: kern/137443: [headers] Including /usr/include/rpc/xdr.h fails with C++ Date: Thu, 30 Aug 2012 15:21:11 -0500 This is a multi-part message in MIME format. --------------040301090709070801000904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This patch should fix it. I will be reviewing other RPC headers as well. Pedro. --------------040301090709070801000904 Content-Type: text/plain; charset=UTF-8; name="patch-c++-xdr.h.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-c++-xdr.h.txt" Index: include/rpc/xdr.h =================================================================== --- include/rpc/xdr.h (revision 239918) +++ include/rpc/xdr.h (working copy) @@ -43,6 +43,10 @@ #define _RPC_XDR_H #include +#ifdef __cplusplus +extern "C" { +#endif + /* * XDR provides a conventional way for converting between C data * types and an external bit-string representation. Library supplied @@ -97,26 +101,26 @@ * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ @@ -366,4 +370,8 @@ extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_XDR_H */ --------------040301090709070801000904--