summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-03-07 14:54:22 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-03-07 14:54:22 +0000
commit009bbccb69fbf9a6872b34c22c32f55d5aa6888a (patch)
treeba8b5d1406836dc0cca3fd02a10b050ec4fe673f /src/mesa
parentb5a56e2480c71581a5c1345fa4b6acc2d67f17cf (diff)
added OS/2 version of IROUND (Evgeny Kotsuba)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/imports.h13
1 files changed, 11 insertions, 2 deletions
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