KeQueryPerformanceCounter(): Workaround return of GCC gint64 for W32 LARGE_INTEGER
authorshort <>
Thu, 27 Mar 2003 15:47:44 +0000 (15:47 +0000)
committershort <>
Thu, 27 Mar 2003 15:47:44 +0000 (15:47 +0000)
src/libcaptive/halcaptive/perfcnt.c

index 8db12a8..cfc186b 100644 (file)
  *
  * Returns: Current system timer ticks count with unspecified base.
  * You will want to subtract two such values to get some timing result.
+ * libcaptive must return #gint64 instead of the official #LARGE_INTEGER
+ * as W32 expects it as value in EAX:EDX but GCC returns the structure address in EAX.
  */
-LARGE_INTEGER KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq)
+gint64 /* instead of LARGE_INTEGER */ KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq)
 {
 LARGE_INTEGER  r;
 struct timeval tv;
@@ -50,5 +52,5 @@ int errint;
        if (PerformanceFreq)
                PerformanceFreq->QuadPart=1000000;
 
-       return r;
+       return r.QuadPart;
 }