summaryrefslogtreecommitdiff
path: root/src/qcommon
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon')
-rw-r--r--src/qcommon/common.c31
-rw-r--r--src/qcommon/q_math.c29
-rw-r--r--src/qcommon/q_platform.h8
3 files changed, 37 insertions, 31 deletions
diff --git a/src/qcommon/common.c b/src/qcommon/common.c
index 5589b384..01183da0 100644
--- a/src/qcommon/common.c
+++ b/src/qcommon/common.c
@@ -3108,37 +3108,6 @@ void Com_Shutdown (void) {
}
-//------------------------------------------------------------------------
-
-
-/*
-=====================
-Q_acos
-
-the msvc acos doesn't always return a value between -PI and PI:
-
-int i;
-i = 1065353246;
-acos(*(float*) &i) == -1.#IND0
-
- This should go in q_math but it is too late to add new traps
- to game and ui
-=====================
-*/
-float Q_acos(float c) {
- float angle;
-
- angle = acos(c);
-
- if (angle > M_PI) {
- return (float)M_PI;
- }
- if (angle < -M_PI) {
- return (float)M_PI;
- }
- return angle;
-}
-
/*
===========================================
command line completion
diff --git a/src/qcommon/q_math.c b/src/qcommon/q_math.c
index 7a480510..be06f226 100644
--- a/src/qcommon/q_math.c
+++ b/src/qcommon/q_math.c
@@ -1297,3 +1297,32 @@ int Q_isnan( float x )
return (int)( (unsigned int)fi.ui >> 31 );
}
+//------------------------------------------------------------------------
+
+#ifndef Q3_VM
+/*
+=====================
+Q_acos
+
+the msvc acos doesn't always return a value between -PI and PI:
+
+int i;
+i = 1065353246;
+acos(*(float*) &i) == -1.#IND0
+
+=====================
+*/
+float Q_acos(float c) {
+ float angle;
+
+ angle = acos(c);
+
+ if (angle > M_PI) {
+ return (float)M_PI;
+ }
+ if (angle < -M_PI) {
+ return (float)M_PI;
+ }
+ return angle;
+}
+#endif
diff --git a/src/qcommon/q_platform.h b/src/qcommon/q_platform.h
index f4335489..e29fb396 100644
--- a/src/qcommon/q_platform.h
+++ b/src/qcommon/q_platform.h
@@ -74,6 +74,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// for windows fastcall option
#define QDECL
+#define QCALL
//================================================================= WIN64/32 ===
@@ -85,6 +86,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#undef QDECL
#define QDECL __cdecl
+#undef QCALL
+#define QCALL __stdcall
+
#if defined( _MSC_VER )
#define OS_STRING "win_msvc64"
#elif defined __MINGW64__
@@ -109,6 +113,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#undef QDECL
#define QDECL __cdecl
+#undef QCALL
+#define QCALL __stdcall
+
#if defined( _MSC_VER )
#define OS_STRING "win_msvc"
#elif defined __MINGW32__
@@ -130,6 +137,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
+
//============================================================== MAC OS X ===
#if defined(MACOS_X) || defined(__APPLE_CC__)