From ce2cb9d8bf579951cd4c33d15846bc088910b921 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Thu, 13 Oct 2011 06:55:12 +0000 Subject: [PATCH] Evas: faster "lround" SVN revision: 64036 --- legacy/evas/src/lib/include/evas_common.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h index 726790c155..6d6824089e 100644 --- a/legacy/evas/src/lib/include/evas_common.h +++ b/legacy/evas/src/lib/include/evas_common.h @@ -22,9 +22,11 @@ #include #ifndef HAVE_LROUND -// right now i dont care about rendering bugs on platforms without lround -// (e.g. windows/vc++... yay!) -#define lround(x) ((long int)(x + (x / (2.0 * abs(x))))) +/* right now i dont care about rendering bugs on platforms without lround + (e.g. windows/vc++... yay!) + FIXME: http://cgit.freedesktop.org/cairo/tree/src/cairo-misc.c#n487 +*/ +#define lround(x) (((x) < 0) ? (long int)ceil((x) - 0.5) : (long int)floor((x) + 0.5)) #endif /* macros needed to log message through eina_log */