From nobody@FreeBSD.org  Wed Aug  5 04:03:29 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A90F1106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Aug 2009 04:03:29 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 619098FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Aug 2009 04:03:29 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7543SfA022462
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 5 Aug 2009 04:03:28 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7543SfM022461;
	Wed, 5 Aug 2009 04:03:28 GMT
	(envelope-from nobody)
Message-Id: <200908050403.n7543SfM022461@www.freebsd.org>
Date: Wed, 5 Aug 2009 04:03:28 GMT
From: Stas Timokhin <devel@stasyan.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Including /usr/include/rpc/xdr.h fails with C++
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         137443
>Category:       kern
>Synopsis:       [headers] Including /usr/include/rpc/xdr.h fails with C++
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pfg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 05 04:10:03 UTC 2009
>Closed-Date:    Sun Sep 16 00:38:17 UTC 2012
>Last-Modified:  Sun Sep 16 00:40:12 UTC 2012
>Originator:     Stas Timokhin
>Release:        8.0-CURRENT
>Organization:
None
>Environment:
FreeBSD home.stasyan.com 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Fri Jun 12 14:30:16 NOVST 2009     root@home.stasyan.com:/usr/src/sys/i386/compile/EASTERN200906  i386

>Description:
Building of C++ application (Salome) fail with current version rpc/xdr.h header:
====================
In file included from ../.././../src/Communication/Receivers.cxx:239,
                 from ../.././../src/Communication/Receivers.hxx:151,
                 from ../.././../src/Communication/ReceiverFactory.cxx:27:
/usr/include/rpc/xdr.h:125: error: conflicting declaration 'typedef struct __rpc_xdr XDR'
./.././../src/Communication/Receivers.hxx:127: error: 'struct XDR' has a previous declaration as 'struct XDR'
/usr/include/rpc/xdr.h: In function 'int xdr_getint32(XDR*, int32_t*)':
/usr/include/rpc/xdr.h:168: error: invalid use of incomplete type 'struct XDR'
./.././../src/Communication/Receivers.hxx:127: error: forward declaration of 'struct XDR'
/usr/include/rpc/xdr.h: In function 'int xdr_putint32(XDR*, int32_t*)':
/usr/include/rpc/xdr.h:180: error: invalid use of incomplete type 'struct XDR'
./.././../src/Communication/Receivers.hxx:127: error: forward declaration of 'struct XDR'
In file included from ../.././../src/Communication/Receivers.hxx:151,
======================



>How-To-Repeat:

>Fix:
Replace all "__rpc_xdr" to "XDR" in /usr/include/rpc/xdr.h in typedef struct  XDR.
C-applications (net/samba3, for example) and C++ applications (salome, not in ports yet) will be build OK.



>Release-Note:
>Audit-Trail:

From: Pedro Giffuni <pfg@FreeBSD.org>
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 <sys/cdefs.h>
  
 +#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--
Responsible-Changed-From-To: freebsd-bugs->pfg 
Responsible-Changed-By: pfg 
Responsible-Changed-When: Sun Sep 2 20:34:23 UTC 2012 
Responsible-Changed-Why:  
I'll grab this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137443 
State-Changed-From-To: open->patched 
State-Changed-By: pfg 
State-Changed-When: Sun Sep 2 21:07:08 UTC 2012 
State-Changed-Why:  
Fix committed in -current 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137443 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/137443: commit references a PR
Date: Sun,  2 Sep 2012 21:04:53 +0000 (UTC)

 Author: pfg
 Date: Sun Sep  2 21:04:40 2012
 New Revision: 240060
 URL: http://svn.freebsd.org/changeset/base/240060
 
 Log:
   Fix RPC headers for C++
   
   C++ mangling will cause trouble with variables like __rpc_xdr
   in xdr.h so rename this to XDR.
   While here add proper C++ guards to RPC headers.
   
   PR:		137443
   MFC after:	2 weeks
 
 Modified:
   head/include/rpc/auth.h
   head/include/rpc/auth_unix.h
   head/include/rpc/clnt.h
   head/include/rpc/clnt_soc.h
   head/include/rpc/des_crypt.h
   head/include/rpc/nettype.h
   head/include/rpc/pmap_clnt.h
   head/include/rpc/pmap_rmt.h
   head/include/rpc/rpc_com.h
   head/include/rpc/rpc_msg.h
   head/include/rpc/rpcb_clnt.h
   head/include/rpc/rpcent.h
   head/include/rpc/rpcsec_gss.h
   head/include/rpc/svc.h
   head/include/rpc/svc_soc.h
   head/include/rpc/xdr.h
   head/sys/rpc/rpc_com.h
   head/sys/rpc/xdr.h
 
 Modified: head/include/rpc/auth.h
 ==============================================================================
 --- head/include/rpc/auth.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/auth.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -51,6 +51,10 @@
  #include <sys/cdefs.h>
  #include <sys/socket.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  #define MAX_AUTH_BYTES	400
  #define MAXNETNAMELEN	255	/* maximum length of network user's name */
  
 @@ -366,4 +370,8 @@ __END_DECLS
  #define	RPCSEC_GSS_KRB5I	390004
  #define	RPCSEC_GSS_KRB5P	390005
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_AUTH_H */
 
 Modified: head/include/rpc/auth_unix.h
 ==============================================================================
 --- head/include/rpc/auth_unix.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/auth_unix.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -48,6 +48,10 @@
  #define _RPC_AUTH_UNIX_H
  #include <sys/cdefs.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  /* The machine name is part of a credential; it may not exceed 255 bytes */
  #define MAX_MACHINE_NAME 255
  
 @@ -81,4 +85,8 @@ struct short_hand_verf {
  	struct opaque_auth new_cred;
  };
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_AUTH_UNIX_H */
 
 Modified: head/include/rpc/clnt.h
 ==============================================================================
 --- head/include/rpc/clnt.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/clnt.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -64,6 +64,10 @@
  #include <netconfig.h>
  #include <sys/un.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  /*
   * Well-known IPV6 RPC broadcast address.
   */
 @@ -551,6 +555,10 @@ extern enum clnt_stat rpc_broadcast_exp(
  					const int, const char *);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  /* For backward compatibility */
  #include <rpc/clnt_soc.h>
  
 
 Modified: head/include/rpc/clnt_soc.h
 ==============================================================================
 --- head/include/rpc/clnt_soc.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/clnt_soc.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -49,6 +49,10 @@
  
  #include <sys/cdefs.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  #define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */  
  
  /*
 @@ -103,4 +107,8 @@ extern CLIENT *clntudp_bufcreate(struct 
  				 struct timeval, int *, u_int, u_int);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* _RPC_CLNT_SOC_H */
 
 Modified: head/include/rpc/des_crypt.h
 ==============================================================================
 --- head/include/rpc/des_crypt.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/des_crypt.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -47,6 +47,10 @@
  #include <sys/cdefs.h>
  #include <rpc/rpc.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  #define DES_MAXDATA 8192	/* max bytes encrypted in one call */
  #define DES_DIRMASK (1 << 0)
  #define DES_ENCRYPT (0*DES_DIRMASK)	/* Encrypt */
 @@ -103,4 +107,8 @@ __BEGIN_DECLS
  void des_setparity( char *);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif  /* _DES_DES_CRYPT_H */
 
 Modified: head/include/rpc/nettype.h
 ==============================================================================
 --- head/include/rpc/nettype.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/nettype.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -44,6 +44,10 @@
  
  #include <netconfig.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  #define	_RPC_NONE	0
  #define	_RPC_NETPATH	1
  #define	_RPC_VISIBLE	2
 @@ -61,4 +65,8 @@ extern struct netconfig *__rpc_getconf(v
  extern struct netconfig *__rpc_getconfip(const char *);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif	/* !_RPC_NETTYPE_H */
 
 Modified: head/include/rpc/pmap_clnt.h
 ==============================================================================
 --- head/include/rpc/pmap_clnt.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/pmap_clnt.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -66,6 +66,10 @@
  #define _RPC_PMAP_CLNT_H_
  #include <sys/cdefs.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  __BEGIN_DECLS
  extern bool_t		pmap_set(u_long, u_long, int, int);
  extern bool_t		pmap_unset(u_long, u_long);
 @@ -83,4 +87,8 @@ extern u_short		pmap_getport(struct sock
  				     u_long, u_long, u_int);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_PMAP_CLNT_H_ */
 
 Modified: head/include/rpc/pmap_rmt.h
 ==============================================================================
 --- head/include/rpc/pmap_rmt.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/pmap_rmt.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -44,6 +44,10 @@
  #define _RPC_PMAP_RMT_H
  #include <sys/cdefs.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  struct rmtcallargs {
  	u_long prog, vers, proc, arglen;
  	caddr_t args_ptr;
 @@ -62,4 +66,8 @@ extern bool_t xdr_rmtcall_args(XDR *, st
  extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_PMAP_RMT_H */
 
 Modified: head/include/rpc/rpc_com.h
 ==============================================================================
 --- head/include/rpc/rpc_com.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/rpc_com.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -42,9 +42,13 @@
  #ifndef _RPC_RPCCOM_H
  #define	_RPC_RPCCOM_H
  
 +/* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
 +
  #include <sys/cdefs.h>
  
 -/* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
 +#ifdef __cplusplus
 +extern "C" {
 +#endif
  
  /*
   * The max size of the transport, if the size cannot be determined
 @@ -80,4 +84,8 @@ char *_get_next_token(char *, int);
  
  __END_DECLS
  
 +#ifdef __cplusplus
 +}
 +#endif
 +
  #endif /* _RPC_RPCCOM_H */
 
 Modified: head/include/rpc/rpc_msg.h
 ==============================================================================
 --- head/include/rpc/rpc_msg.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/rpc_msg.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -43,6 +43,10 @@
  #ifndef _RPC_RPC_MSG_H
  #define _RPC_RPC_MSG_H
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  #define RPC_MSG_VERSION		((u_int32_t) 2)
  #define RPC_SERVICE_PORT	((u_short) 2048)
  
 @@ -211,4 +215,8 @@ extern bool_t	xdr_rejected_reply(XDR *, 
  extern void	_seterr_reply(struct rpc_msg *, struct rpc_err *);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_RPC_MSG_H */
 
 Modified: head/include/rpc/rpcb_clnt.h
 ==============================================================================
 --- head/include/rpc/rpcb_clnt.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/rpcb_clnt.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -61,6 +61,10 @@
  #include <rpc/types.h>
  #include <rpc/rpcb_prot.h>
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  __BEGIN_DECLS
  extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
  		       const struct netconfig  *, const struct netbuf *);
 @@ -82,4 +86,8 @@ extern char *rpcb_taddr2uaddr(struct net
  extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif	/* !_RPC_RPCB_CLNT_H */
 
 Modified: head/include/rpc/rpcent.h
 ==============================================================================
 --- head/include/rpc/rpcent.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/rpcent.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -45,6 +45,9 @@
  /*	#pragma ident "@(#)rpcent.h   1.13    94/04/25 SMI"	*/
  /*      @(#)rpcent.h 1.1 88/12/06 SMI   */
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
  
  struct rpcent {
        char    *r_name;        /* name of server for this rpc program */
 @@ -64,4 +67,8 @@ extern void setrpcent(int);
  extern void endrpcent(void);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_CENT_H */
 
 Modified: head/include/rpc/rpcsec_gss.h
 ==============================================================================
 --- head/include/rpc/rpcsec_gss.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/rpcsec_gss.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -29,6 +29,10 @@
  #ifndef _RPCSEC_GSS_H
  #define _RPCSEC_GSS_H
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  #include <gssapi/gssapi.h>
  
  #ifndef MAX_GSS_MECH
 @@ -176,4 +180,8 @@ bool_t __rpc_gss_set_error(int rpc_gss_e
  
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPCSEC_GSS_H */
 
 Modified: head/include/rpc/svc.h
 ==============================================================================
 --- head/include/rpc/svc.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/svc.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -65,6 +65,10 @@
   * parameters, struct svc_req * and SVCXPRT *, defined below.
   */
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  /*
   *      Service control requests
   */
 @@ -467,6 +471,9 @@ int __rpc_get_local_uid(SVCXPRT *_transp
  
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
  
  /* for backward compatibility */
  #include <rpc/svc_soc.h>
 
 Modified: head/include/rpc/svc_soc.h
 ==============================================================================
 --- head/include/rpc/svc_soc.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/svc_soc.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -49,6 +49,10 @@
   * with TS-RPC
   */
  
 +#ifdef	__cplusplus
 +extern "C" {
 +#endif
 +
  /*
   *  Approved way of getting address of caller
   */
 @@ -113,4 +117,8 @@ __BEGIN_DECLS
  extern SVCXPRT *svcfd_create(int, u_int, u_int);
  __END_DECLS
  
 +#ifdef	__cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_SVC_SOC_H */
 
 Modified: head/include/rpc/xdr.h
 ==============================================================================
 --- head/include/rpc/xdr.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/include/rpc/xdr.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -43,6 +43,10 @@
  #define _RPC_XDR_H
  #include <sys/cdefs.h>
  
 +#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 @@ enum xdr_op {
   * 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 bool_t xdrrec_eof(XDR *);
  extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
  __END_DECLS
  
 +#ifdef __cplusplus
 +}
 +#endif
 +
  #endif /* !_RPC_XDR_H */
 
 Modified: head/sys/rpc/rpc_com.h
 ==============================================================================
 --- head/sys/rpc/rpc_com.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/sys/rpc/rpc_com.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -114,8 +114,8 @@ extern int __rpc_sockisbound(struct sock
  extern int bindresvport(struct socket *so, struct sockaddr *sa);
  
  struct xucred;
 -struct __rpc_xdr;
 -bool_t xdr_authunix_parms(struct __rpc_xdr *xdrs, uint32_t *time, struct xucred *cred);
 +struct XDR;
 +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred *cred);
  #endif
  
  __END_DECLS
 
 Modified: head/sys/rpc/xdr.h
 ==============================================================================
 --- head/sys/rpc/xdr.h	Sun Sep  2 18:54:51 2012	(r240059)
 +++ head/sys/rpc/xdr.h	Sun Sep  2 21:04:40 2012	(r240060)
 @@ -97,26 +97,26 @@ enum xdr_op {
   * 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 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: pfg 
State-Changed-When: Sun Sep 16 00:36:33 UTC 2012 
State-Changed-Why:  
Committed and MFC'd to 9 and 8 stable branches. 
Thank you for your contribution! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137443 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/137443: commit references a PR
Date: Sun, 16 Sep 2012 00:32:38 +0000 (UTC)

 Author: pfg
 Date: Sun Sep 16 00:32:25 2012
 New Revision: 240542
 URL: http://svn.freebsd.org/changeset/base/240542
 
 Log:
   MFC	r240060, r240062:
   
   Rename __rpc_xdr with XDR. This fixes at least one C++ application and
   matches what upstream (Solaris) has done on their xdr.h header.
   
   PR:	137443
 
 Modified:
   stable/9/include/rpc/xdr.h
   stable/9/sys/rpc/rpc_com.h
   stable/9/sys/rpc/xdr.h
 
 Modified: stable/9/include/rpc/xdr.h
 ==============================================================================
 --- stable/9/include/rpc/xdr.h	Sat Sep 15 21:56:30 2012	(r240541)
 +++ stable/9/include/rpc/xdr.h	Sun Sep 16 00:32:25 2012	(r240542)
 @@ -97,26 +97,26 @@ enum xdr_op {
   * 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 */
 
 Modified: stable/9/sys/rpc/rpc_com.h
 ==============================================================================
 --- stable/9/sys/rpc/rpc_com.h	Sat Sep 15 21:56:30 2012	(r240541)
 +++ stable/9/sys/rpc/rpc_com.h	Sun Sep 16 00:32:25 2012	(r240542)
 @@ -114,8 +114,8 @@ extern int __rpc_sockisbound(struct sock
  extern int bindresvport(struct socket *so, struct sockaddr *sa);
  
  struct xucred;
 -struct __rpc_xdr;
 -bool_t xdr_authunix_parms(struct __rpc_xdr *xdrs, uint32_t *time, struct xucred *cred);
 +struct XDR;
 +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred *cred);
  #endif
  
  __END_DECLS
 
 Modified: stable/9/sys/rpc/xdr.h
 ==============================================================================
 --- stable/9/sys/rpc/xdr.h	Sat Sep 15 21:56:30 2012	(r240541)
 +++ stable/9/sys/rpc/xdr.h	Sun Sep 16 00:32:25 2012	(r240542)
 @@ -97,26 +97,26 @@ enum xdr_op {
   * 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 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/137443: commit references a PR
Date: Sun, 16 Sep 2012 00:34:19 +0000 (UTC)

 Author: pfg
 Date: Sun Sep 16 00:34:04 2012
 New Revision: 240543
 URL: http://svn.freebsd.org/changeset/base/240543
 
 Log:
   MFC	r240060, r240062:
   
   Rename __rpc_xdr with XDR. This fixes at least one C++ application and
   matches what upstream (Solaris) has done on their xdr.h header.
   
   PR:	137443
 
 Modified:
   stable/8/include/rpc/xdr.h
   stable/8/sys/rpc/rpc_com.h
   stable/8/sys/rpc/xdr.h
 Directory Properties:
   stable/8/include/rpc/   (props changed)
   stable/8/sys/rpc/   (props changed)
 
 Modified: stable/8/include/rpc/xdr.h
 ==============================================================================
 --- stable/8/include/rpc/xdr.h	Sun Sep 16 00:32:25 2012	(r240542)
 +++ stable/8/include/rpc/xdr.h	Sun Sep 16 00:34:04 2012	(r240543)
 @@ -97,26 +97,26 @@ enum xdr_op {
   * 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 */
 
 Modified: stable/8/sys/rpc/rpc_com.h
 ==============================================================================
 --- stable/8/sys/rpc/rpc_com.h	Sun Sep 16 00:32:25 2012	(r240542)
 +++ stable/8/sys/rpc/rpc_com.h	Sun Sep 16 00:34:04 2012	(r240543)
 @@ -114,8 +114,8 @@ extern int __rpc_sockisbound(struct sock
  extern int bindresvport(struct socket *so, struct sockaddr *sa);
  
  struct xucred;
 -struct __rpc_xdr;
 -bool_t xdr_authunix_parms(struct __rpc_xdr *xdrs, uint32_t *time, struct xucred *cred);
 +struct XDR;
 +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred *cred);
  #endif
  
  __END_DECLS
 
 Modified: stable/8/sys/rpc/xdr.h
 ==============================================================================
 --- stable/8/sys/rpc/xdr.h	Sun Sep 16 00:32:25 2012	(r240542)
 +++ stable/8/sys/rpc/xdr.h	Sun Sep 16 00:34:04 2012	(r240543)
 @@ -97,26 +97,26 @@ enum xdr_op {
   * 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 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
