From: Jesse Gross Date: Thu, 3 Mar 2011 21:38:09 +0000 (-0800) Subject: datapath: Add backport for USHRT_MAX. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f45ee2cd9a8cd2a4f2a60fd36da9f95775e2efa6;p=openvswitch datapath: Add backport for USHRT_MAX. Kernels before 2.6.26 didn't have type limits for short at all and before 2.6.35 it was called SHORT instead of SHRT. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h index 1c9f4014..2c2220b9 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h @@ -48,4 +48,10 @@ #error "CONFIG_PREEMPT is broken before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\"" #endif +#ifndef USHRT_MAX +#define USHRT_MAX ((u16)(~0U)) +#define SHRT_MAX ((s16)(USHRT_MAX>>1)) +#define SHRT_MIN ((s16)(-SHRT_MAX - 1)) +#endif + #endif /* linux/kernel.h */