datapath-windows: fix MIN() macro
authorNithin Raju <nithin@vmware.com>
Wed, 25 Nov 2015 20:16:30 +0000 (12:16 -0800)
committerBen Pfaff <blp@ovn.org>
Thu, 26 Nov 2015 05:55:33 +0000 (21:55 -0800)
commit09dbf169e129778d25e7e69a1d87d4e00cf34505
treef4bd2dc2497001149a933e22039be7bf3de65a20
parentbc06cc7659c6d7e9a854d1d5fee83e44ba35a409
datapath-windows: fix MIN() macro

A quick implementation of MIN() didn't take into account operator
precedence as shown in the following example:

 #include <stdio.h>
 #define MYMIN(_a, _b) (_a) > (_b) ? (_b) : (_a)
 int main() {
     if (MYMIN(512, 256) < 14) {
         printf("buggy MYMIN\n");
     }
     return 0;
 }

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
datapath-windows/ovsext/Util.h