[PATCH] net: add more sockopt options

Dmitry V. Levin ldv at altlinux.org
Fri Jan 31 16:10:54 UTC 2014


On Fri, Jan 31, 2014 at 01:27:14AM -0500, Mike Frysinger wrote:
> > what would help i think with maintaining these files is a little macro that
> > i use in other projects of mine:
> > 	#define Q(x) { x, #x },
> > then the lists become:
> > static const struct xlat domains[] = {
> > 	Q(PF_UNSPEC)
> > 	Q(PF_LOCAL)
> > 	Q(PF_UNIX)
> > 	...
> > };
> 
> 
> blah i'm dumb and forgot about the #ifdef part.  it's still a bit cleaner 
> though:
> 
> 
> --- a/defs.h
> +++ b/defs.h
> @@ -503,6 +503,7 @@ struct xlat {
>  	int val;
>  	const char *str;
>  };
> +#define XLAT(x) { x, #x }
>  
>  extern const struct xlat open_mode_flags[];
>  extern const struct xlat addrfams[];

Agreed.  Please write a commit message. :)


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140131/3cf2ee95/attachment.bin>


More information about the Strace-devel mailing list