1
0
forked from 0ad/0ad
0ad/source/lib/sysdep/sysdep.cpp
janwas e2f25f4598 - self test: rename stuff to SELF_TEST*; add provision for delayed all-at-once self tests (allows for init before the test and makes measuring elapsed time easier)
- config: add CONFIG_TRACE
- display_error_impl->sys_display_error
- cleaned up sysdep; add sys_ prefix everywhere and document everything
- add to vfs_load dox
- cursor: sys_cursor_load -> sys_cursor_create. sysdep code is no longer
dependent on tex; instead of calling tex_load, the caller passes a BGRA
texture in.
memcpy: huge kick in the pants for accompanying paper; now even faster.
- on_each_cpu -> sys_on_each_cpu (removed manager function also)
- wsdl: explain PeekMessage CPU usage issue

This was SVN commit r3203.
2005-12-07 03:38:39 +00:00

69 lines
924 B
C++
Executable File

#include "precompiled.h"
#include "lib.h"
#include "sysdep.h"
#if CPU_IA32
# include "ia32.h"
#endif
#if OS_WIN
# include "win/wcpu.h"
#endif
#include <memory.h>
#include <stdarg.h>
#if !HAVE_C99
float fminf(float a, float b)
{
return (a < b)? a : b;
}
float fmaxf(float a, float b)
{
return (a > b)? a : b;
}
#endif
// no C99, and not running on IA-32 (where this is defined to ia32_rint)
// => need to implement our fallback version.
#if !HAVE_C99 && !defined(rint)
inline float rintf(float f)
{
return (float)(int)f;
}
inline double rint(double d)
{
return (double)(int)d;
}
#endif
// float->int conversion: not using the ia32 version; just implement as a
// cast. (see USE_IA32_FLOAT_TO_INT definition for details)
#if !USE_IA32_FLOAT_TO_INT
i32 i32_from_float(float f)
{
return (i32)f;
}
i32 i32_from_double(double d)
{
return (i32)d;
}
i64 i64_from_double(double d)
{
return (i64)d;
}
#endif