diff options
| author | Jesse Gross <jesse@nicira.com> | 2011-03-03 13:38:09 -0800 |
|---|---|---|
| committer | Jesse Gross <jesse@nicira.com> | 2011-03-03 14:57:18 -0800 |
| commit | f45ee2cd9a8cd2a4f2a60fd36da9f95775e2efa6 (patch) | |
| tree | 430f9300de81a6a36ba4eedea061db577b10fbd2 /datapath | |
| parent | fdd89fdc9943878e7cb1c43ba872b13f26c25e59 (diff) | |
| download | openvswitch-f45ee2cd9a8cd2a4f2a60fd36da9f95775e2efa6.tar.gz | |
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 <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath')
| -rw-r--r-- | datapath/linux-2.6/compat-2.6/include/linux/kernel.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 1c9f40147..2c2220b9f 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 */ |
