X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmacro.h;h=2bb72f0d167626413aa5d91c1182050cc41da57d;hb=a858b64dddf79177e12ed30f5e8c47a1471c8bfe;hp=f91f7de76956da0de546cf4bdba1b9c7c66650ca;hpb=fc6e6d245ee3989c222a2a8cc82a33475f9922f3;p=elogind.git diff --git a/src/shared/macro.h b/src/shared/macro.h index f91f7de76..2bb72f0d1 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -272,11 +272,12 @@ do { \ * signed int in the kernel and these negative numbers are extended to * long, which cannot be simply compared to the magic constants anymore. */ -#define CMP_F_TYPE(f, c) \ +#define F_TYPE_CMP(f_type, magic) \ __extension__ ({ \ - __SWORD_TYPE _f = (f); \ - const __SWORD_TYPE _c = (c); \ - const int _c32 = (c); \ + __SWORD_TYPE _f = (f_type); \ + const __SWORD_TYPE _c = (magic); \ + const int _c32 = 1 ? (magic) \ + : sizeof((int[magic]){0}); \ (_f == _c || _f == _c32 ); \ })