diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-20 12:31:58 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-20 12:31:58 -0300 |
commit | 6c611aa512f9f31e8880be5aa826b26e31d79cf9 (patch) | |
tree | a7e1f50531cc6aac1e1796c25ea06ad6fbbbb11f | |
parent | 3a5d86fcd1ef7eb3617d26046cdffea4245ca987 (diff) | |
download | mediapointer-dvb-s2-6c611aa512f9f31e8880be5aa826b26e31d79cf9.tar.gz mediapointer-dvb-s2-6c611aa512f9f31e8880be5aa826b26e31d79cf9.tar.bz2 |
compat.h: implement DIV_ROUND_CLOSEST
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | v4l/compat.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index e73f03087..51e4408d4 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -72,6 +72,15 @@ #define vmalloc_32_user(a) vmalloc_32(a) #endif +#ifndef DIV_ROUND_CLOSEST +#define DIV_ROUND_CLOSEST(x, divisor)( \ +{ \ + typeof(divisor) __divisor = divisor; \ + (((x) + ((__divisor) / 2)) / (__divisor)); \ +} \ +) +#endif + #ifdef NEED_BOOL_TYPE /* bool type and enum-based definition of true and false was added in 2.6.19 */ typedef int bool; |