datapath: Add backport for USHRT_MAX.
authorJesse Gross <jesse@nicira.com>
Thu, 3 Mar 2011 21:38:09 +0000 (13:38 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 3 Mar 2011 22:57:18 +0000 (14:57 -0800)
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 <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/linux-2.6/compat-2.6/include/linux/kernel.h

index 1c9f40147d1a21949bf1e51f1bed63c65a91d1a4..2c2220b9f0b3fb73d69c837bc542944c1a2823cb 100644 (file)
 #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 */