From 81fd17c8678e89cea6610b8b2996b028b21eb5dc Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 7 Oct 2013 08:23:46 +0200 Subject: xserver fontconfig libXdmcp mesa pixmand xkeyboard-config git update 7 oct 2013 xserver commit ccbe17b1c6da1ad9d085fc8133cdd15dc7004a4a xkeyboard-config commit c8326b7d12b20eccfd38d661b95d9b23d8a56e27 libXdmcp commit 089081dca4ba3598c6f9bf401c029378943b5854 pixman commit c89f4c826695dbb5df0817d84f845dbd3e28b7a7 fontconfig commit 604c2a683f1357fc65bad372b5d25a90099f827f mesa commit cfbfb50cb8d47b7f6975828b504936f9324f3b12 --- mesalib/src/gallium/auxiliary/util/u_math.h | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'mesalib/src/gallium/auxiliary/util/u_math.h') diff --git a/mesalib/src/gallium/auxiliary/util/u_math.h b/mesalib/src/gallium/auxiliary/util/u_math.h index 702d4e9d4..478a4aa4d 100644 --- a/mesalib/src/gallium/auxiliary/util/u_math.h +++ b/mesalib/src/gallium/auxiliary/util/u_math.h @@ -162,7 +162,59 @@ float log2f(float f) #endif +#if __STDC_VERSION__ < 199901L && !defined(__cplusplus) +static INLINE long int +lrint(double d) +{ + long int rounded = (long int)(d + 0.5); + + if (d - floor(d) == 0.5) { + if (rounded % 2 != 0) + rounded += (d > 0) ? -1 : 1; + } + + return rounded; +} + +static INLINE long int +lrintf(float f) +{ + long int rounded = (long int)(f + 0.5f); + + if (f - floorf(f) == 0.5f) { + if (rounded % 2 != 0) + rounded += (f > 0) ? -1 : 1; + } + + return rounded; +} +static INLINE long long int +llrint(double d) +{ + long long int rounded = (long long int)(d + 0.5); + + if (d - floor(d) == 0.5) { + if (rounded % 2 != 0) + rounded += (d > 0) ? -1 : 1; + } + + return rounded; +} + +static INLINE long long int +llrintf(float f) +{ + long long int rounded = (long long int)(f + 0.5f); + + if (f - floorf(f) == 0.5f) { + if (rounded % 2 != 0) + rounded += (f > 0) ? -1 : 1; + } + + return rounded; +} +#endif /* C99 */ #define POW2_TABLE_SIZE_LOG2 9 #define POW2_TABLE_SIZE (1 << POW2_TABLE_SIZE_LOG2) -- cgit v1.2.3