X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmacro.h;h=d4f92b60ec83ac37a88d932cf817d3d71413a308;hb=8b179a830a789746cce0be6671e2de235e3b0ea9;hp=2f151bcc8cb143f5c80d7d33c7de81a2d4c3236f;hpb=a3dc35472f3a48ea8445ad7a943e2ff253170417;p=elogind.git diff --git a/src/shared/macro.h b/src/shared/macro.h index 2f151bcc8..d4f92b60e 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -271,7 +271,7 @@ do { \ * the const magic to the type, otherwise the compiler warns about * signed/unsigned comparison, because the magic can be 32 bit unsigned. */ -#define F_TYPE_CMP(a, b) (a == (typeof(a)) b) +#define F_TYPE_EQUAL(a, b) (a == (typeof(a)) b) /* Returns the number of chars needed to format variables of the @@ -284,4 +284,7 @@ do { \ sizeof(type) <= 4 ? 10 : \ sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)]))) +#define SET_FLAG(v, flag, b) \ + (v) = (b) ? ((v) | (flag)) : ((v) & ~(flag)) + #include "log.h"