X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2Fmacros.h;h=1c978ed4d9d73703924171c95bc73b91ff4e1dc4;hp=9784c7aa3c2b5fa91fb67ec4480a3e45d309cbef;hb=eefeeaee57a56cfe1ff8c02a26c44d6f87f1368c;hpb=9c3be0a6a901fad667ba1abcd8b46c712020cf26 diff --git a/sources/macros.h b/sources/macros.h index 9784c7a..1c978ed 100644 --- a/sources/macros.h +++ b/sources/macros.h @@ -23,10 +23,12 @@ (v>>24) | ((v>>8)&0xFF00) | (v<<24) | ((v<<8)&0xFF0000); } ) #define BE16_TO_LE16(val) ({typeof (val) v= (val); (v>>8) | (v<<8); } ) /* - * Define a protected, right typed, no side effects macro for min + * Define a protected, right typed, no side effects macro for min and max */ #define min(x, y) ({typeof (x) x_ = (x); typeof (y) y_ = (y); \ x_ < y_ ? x_ : y_;}) +#define max(x, y) ({typeof (x) x_ = (x); typeof (y) y_ = (y); \ + x_ > y_ ? x_ : y_;}) /* * debugging print definition */