On Thu, Feb 06, 2020 at 05:41:52PM +0100, Hans Petter Selasky wrote: > On 2020-02-06 13:45, Pawel Biernacki wrote: > > +#ifdef notyet > > +#define SYSCTL_ENFORCE_FLAGS(x) > > \ > > + _Static_assert(((CTLFLAG_MPSAFE ^ CTLFLAG_NEEDGIANT) & (x)), \ > > + "Has to be either CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT") > > +#else > > +#define SYSCTL_ENFORCE_FLAGS(x) > > +#endif > > Like cem@ pointed out, either you expand the XOR via OR or you can also do > it like this: > > (((x) & CTLFLAG_MPSAFE) != 0) ^ (((x) & CTLFLAG_NEEDGIANT) != 0) The intent was to do exactly this, xor the bools.
> > which avoids having to define another macro. > > --HPS _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"