Fixes for cygwin and mingw builds.
This commit is contained in:
@@ -56,6 +56,11 @@
|
||||
namespace osg {
|
||||
|
||||
// define the stand trig values
|
||||
#ifdef PI
|
||||
#undef PI
|
||||
#undef PI_2
|
||||
#undef PI_4
|
||||
#endif
|
||||
const double PI = 3.14159265358979323846;
|
||||
const double PI_2 = 1.57079632679489661923;
|
||||
const double PI_4 = 0.78539816339744830962;
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
namespace osg {
|
||||
|
||||
#if defined(WIN32 ) && !defined(__CYGWIN__)
|
||||
#if defined(WIN32 ) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
typedef __int64 Timer_t;
|
||||
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__)
|
||||
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__)|| defined(__MINGW32__)
|
||||
typedef unsigned long long Timer_t;
|
||||
#elif defined(__sgi)
|
||||
typedef unsigned long long Timer_t;
|
||||
@@ -91,8 +91,24 @@ namespace osg{
|
||||
|
||||
}
|
||||
#pragma optimize("",on)
|
||||
|
||||
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
#elif defined(__MINGW32__)
|
||||
#include <sys/time.h>
|
||||
|
||||
#define CLK(x) __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x))
|
||||
namespace osg{
|
||||
|
||||
inline Timer_t Timer::tick() const
|
||||
{
|
||||
if (_useStandardClock)
|
||||
return clock();
|
||||
else
|
||||
{
|
||||
Timer_t x;CLK(x);return x;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__)
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user