PlatformX86UNIX/x86UNIXCPUInfo.cc
by EddieRay · in Torque Game Engine · 04/26/2005 (1:46 pm) · 5 replies
The current HEAD needs a fix something like the following:
*** torque-head-20050426/engine/platformX86UNIX/x86UNIXCPUInfo.cc 2005-03-19 08:02:33.000000000 -0500
--- torque-head/engine/platformX86UNIX/x86UNIXCPUInfo.cc 2005-04-26 11:32:07.733054887 -0400
***************
*** 24,30 ****
--- 24,34 ----
}
/* used in the asm */
+ #if defined(TORQUE_COMPILER_GCC) && ((__GNUC__ >= 3) && (__GNUC_MINOR__ >=4))
+ static U32 timeLo, timeHi;
+ #else
static U32 time[2];
+ #endif
static U32 clockticks = 0;
static char vendor[13] = {0,};
static U32 properties = 0;
***************
*** 57,63 ****
const U32 MS_INTERVAL = 750;
#if defined(TORQUE_COMPILER_GCC) && ((__GNUC__ >= 3) && (__GNUC_MINOR__ >=4))
! asm("rdtsc" : "=a" (timeLo), "\d" (timeHi));
#else
__asm__(
"pushl %eax\n"
--- 61,67 ----
const U32 MS_INTERVAL = 750;
#if defined(TORQUE_COMPILER_GCC) && ((__GNUC__ >= 3) && (__GNUC_MINOR__ >=4))
! asm("rdtsc" : "=a" (timeLo), "=d" (timeHi));
#else
__asm__(
"pushl %eax\n"
***************
*** 84,90 ****
"popl %edx\n"
"popl %eax\n"
);
! #else asm(
"pushl %eax\n"
"pushl %edx\n"
"rdtsc\n"
--- 88,95 ----
"popl %edx\n"
"popl %eax\n"
);
! #else
! asm(
"pushl %eax\n"
"pushl %edx\n"
"rdtsc\n"About the author
#2
It's good to see someone else around here keepin' and eye on the Linux/MinGW side of things... :-)
Thanks,
Ed
04/26/2005 (2:57 pm)
Looks like your fix didn't exactly make it in... ;-)It's good to see someone else around here keepin' and eye on the Linux/MinGW side of things... :-)
Thanks,
Ed
#3
04/27/2005 (11:22 am)
It's in the internal SVN repo. It will get pushed out when TGE 1.4 RC2 goes out.
#4
04/27/2005 (1:28 pm)
Thanks Ben!
#5
#define GNUC_GE_34 (((__GNUC__ >= 3) && (__GNUC_MINOR__ >=4)) || (__GNUC__ >= 4))
06/26/2005 (10:02 pm)
The conditionals need to be fixed to work with GCC 4:#define GNUC_GE_34 (((__GNUC__ >= 3) && (__GNUC_MINOR__ >=4)) || (__GNUC__ >= 4))
Torque Owner Benoit Touchette