From f45ee2cd9a8cd2a4f2a60fd36da9f95775e2efa6 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Thu, 3 Mar 2011 13:38:09 -0800 Subject: [PATCH] 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 --- datapath/linux-2.6/compat-2.6/include/linux/kernel.h | 6 ++++++ 1 file changed, 6 insertions(+) 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 */ -- 2.30.2