[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 13/18] xenstored: support running in minios stubdom



On Wed, 2012-01-18 at 17:13 +0000, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH 13/18] xenstored: support 
> running in minios stubdom"):
> > One thing which might help is to provide nop versions of functions
> > instead of idef'ing both the definition and callsite. e.g. 
> >  static void write_pidfile(const char *pidfile)
> > +#ifndef __MINIOS__
> >      stuff
> > +#else
> > +    nothing
> > +endif
> 
> I would normally prefer:
> 
> > +#ifndef __MINIOS__
> >  static void write_pidfile(const char *pidfile)
> >      stuff
> >  }
> > +#else
> > +static void write_pidfile(const char *pidfile)
> > +}
> > +endif

Yes, I'd normally do it this way too, not sure why I wrote the other...

Only real difference is that it prevents the prototype getting out of
sync and bit-rotting the infrequently used case if there is one.

Ian.

> I think this is fairly easy to read; the only hard part is figuring
> out which version is being used, which can often be done by putting
> the relevant bits in a separate file.
> 
> Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.