You are right, just need to cast #define parameters, then can use the RTE_MIN and MAX. Will do a patch. Thanks, john
> -----Original Message----- > From: Thomas Monjalon <tho...@monjalon.net> > Sent: Sunday, January 19, 2020 12:24 PM > To: John Daley (johndale) <johnd...@cisco.com>; Hyong Youb Kim > (hyonkim) <hyon...@cisco.com> > Cc: ferruh.yi...@intel.com; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] net/enic: move macro to the correct file > > 14/01/2020 01:24, John Daley: > > +#define min_t(type, x, y) ({ \ > > + type __min1 = (x); \ > > + type __min2 = (y); \ > > + __min1 < __min2 ? __min1 : __min2; }) > > + > > +#define max_t(type, x, y) ({ \ > > + type __max1 = (x); \ > > + type __max2 = (y); \ > > + __max1 > __max2 ? __max1 : __max2; }) > > Why not using RTE_MIN/RTE_MAX which use typeof? > You need to specify a type? >