Date: Thu, 6 Feb 2020 23:10:19 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Hans Petter Selasky <hps@selasky.org> Cc: Pawel Biernacki <kaktus@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357614 - in head/sys: kern sys Message-ID: <20200206211019.GS4808@kib.kiev.ua> In-Reply-To: <ed14c28a-d212-e488-898a-cf85ac6ead73@selasky.org> References: <202002061245.016CjwTi096374@repo.freebsd.org> <ed14c28a-d212-e488-898a-cf85ac6ead73@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200206211019.GS4808>