From 009bbccb69fbf9a6872b34c22c32f55d5aa6888a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 7 Mar 2003 14:54:22 +0000 Subject: added OS/2 version of IROUND (Evgeny Kotsuba) --- src/mesa/main/imports.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 73c3b6eb42..8de543b130 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -1,4 +1,4 @@ -/* $Id: imports.h,v 1.17 2003/03/04 16:33:53 brianp Exp $ */ +/* $Id: imports.h,v 1.18 2003/03/07 14:54:22 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -330,8 +330,17 @@ long iround(float f); parm [8087] \ value [eax] \ modify exact [eax]; - #define IROUND(x) iround(x) +#elif defined(__OS2__) +#ifndef FIST_MAGIC +#define FIST_MAGIC ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) +#endif +inline int iround(float x) +{ + double dtemp = FIST_MAGIC + x; + return ((*(int *)&dtemp) - 0x80000000); +} +#define IROUND(f) iround((float)f) #else #define IROUND(f) ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F))) #endif -- cgit v1.2.3