Fixes for cygwin and mingw builds.

This commit is contained in:
Robert Osfield
2002-02-09 10:24:39 +00:00
parent 254d22ec90
commit ed45cccc25
12 changed files with 246 additions and 91 deletions

View File

@@ -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;

View File

@@ -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>