X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fshared%2Fmacro.h;h=ac61b495883dc754f124010428e2b5e36302db78;hb=bdd29249a882e599e5e365536372d08dee398cd4;hp=9bf81dc3cc541229bebe333d8d3ee31074ffe68b;hpb=cbeabcfbc5a5fa27385e5794780e8f034e090606;p=elogind.git diff --git a/src/shared/macro.h b/src/shared/macro.h index 9bf81dc3c..ac61b4958 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -264,6 +264,13 @@ do { \ } \ } while(false) + /* Because statfs.t_type can be int on some architecures, we have to cast + * 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) + + /* Returns the number of chars needed to format variables of the * specified type as a decimal string. Adds in extra space for a * negative '-' prefix. */