X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2Fmacros.h;h=1c978ed4d9d73703924171c95bc73b91ff4e1dc4;hp=9784c7aa3c2b5fa91fb67ec4480a3e45d309cbef;hb=65cdd0498d1d9473110f86ebddede62c298e60dd;hpb=fcd431ebcd9f7a65680a669a2740ef5a2586531c 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 */