[Mono-dev] [Mono-patches] r153961 - trunk/mono/mono/metadata

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Sun Mar 21 18:30:04 EDT 2010


Andreas,

I would just #ifdef out the entire case statement so if that protocol is
used by any program and is not supported, the program will get the
appropriate exception.

-Gonzalo

On Sun, 2010-03-21 at 14:55 -0400, Andreas Färber
(andreas.faerber at web.de) wrote:
> Author: afaerber
> Date: 2010-03-21 14:55:50 -0400 (Sun, 21 Mar 2010)
> New Revision: 153961
> 
> Modified:
>    trunk/mono/mono/metadata/ChangeLog
>    trunk/mono/mono/metadata/socket-io.c
> Log:
> Handle absence of socket constants
> 
> AF_SNA, AF_DECnet and SOCK_RDM are not part of POSIX, and Haiku does not
> supply them.
> Check for their presence before using them, as already done for AF_IPX.
> 
> 2010-03-21  Andreas Faerber  <andreas.faerber at web.de>
> 
> 	* socket-io.c: Don't depend on AF_SNA, AF_DECnet,
> 	SOCK_RDM.
> 
> This commit is licensed under the MIT X11 license.
> 
> Modified: trunk/mono/mono/metadata/ChangeLog
> ===================================================================
> --- trunk/mono/mono/metadata/ChangeLog	2010-03-21 18:06:56 UTC (rev 153960)
> +++ trunk/mono/mono/metadata/ChangeLog	2010-03-21 18:55:50 UTC (rev 153961)
> @@ -1,3 +1,10 @@
> +2010-03-21  Andreas Färber  <andreas.faerber at web.de>
> +
> +	* socket-io.c: Don't depend on AF_SNA, AF_DECnet,
> +	SOCK_RDM.
> +	
> +	Code is contributed under MIT/X11 license.
> +
>  2010-03-20  Sanjoy Das <sanjoy at playingwithpointers.com>
>  
>  	* sgen-gc.c (mono_gc_get_write_barrier): Handle non-aligned
> 
> Modified: trunk/mono/mono/metadata/socket-io.c
> ===================================================================
> --- trunk/mono/mono/metadata/socket-io.c	2010-03-21 18:06:56 UTC (rev 153960)
> +++ trunk/mono/mono/metadata/socket-io.c	2010-03-21 18:55:50 UTC (rev 153961)
> @@ -141,11 +141,15 @@
>  		break;
>  		
>  	case AddressFamily_Sna:
> +#ifdef AF_SNA
>  		family=AF_SNA;
> +#endif
>  		break;
>  		
>  	case AddressFamily_DecNet:
> +#ifdef AF_DECnet
>  		family=AF_DECnet;
> +#endif
>  		break;
>  		
>  	case AddressFamily_AppleTalk:
> @@ -192,13 +196,17 @@
>  		break;
>  #endif
>  		
> +#ifdef AF_SNA
>  	case AF_SNA:
>  		family=AddressFamily_Sna;
>  		break;
> +#endif
>  		
> +#ifdef AF_DECnet
>  	case AF_DECnet:
>  		family=AddressFamily_DecNet;
>  		break;
> +#endif
>  		
>  	case AF_APPLETALK:
>  		family=AddressFamily_AppleTalk;
> @@ -240,7 +248,9 @@
>  		break;
>  
>  	case SocketType_Rdm:
> +#ifdef SOCK_RDM
>  		type=SOCK_RDM;
> +#endif
>  		break;
>  
>  	case SocketType_Seqpacket:
> 
> _______________________________________________
> Mono-patches maillist  -  Mono-patches at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-patches




More information about the Mono-devel-list mailing list