shithub: aubio

Download patch

ref: 1899f0d5c0c50f99d10be258c6f1cec17999b95d
parent: 32c0133601ed869df745dda8f895c0d3ecdcaa7b
author: Paul Brossier <piem@altern.org>
date: Sun Oct 1 11:13:00 EDT 2006

hack around timer.c to pass compilation on windows
hack around timer.c to pass compilation on windows


--- a/ext/midi/timer.c
+++ b/ext/midi/timer.c
@@ -40,6 +40,7 @@
 
 #if 0
 #include <winbase.h>
+#endif
 
 struct _aubio_timer_t 
 {
@@ -73,13 +74,17 @@
   timer->auto_destroy = auto_destroy;
 
   if (new_thread) {
+#if 0
     timer->thread = CreateThread(NULL, 0, aubio_timer_run, (LPVOID) timer, 0, &timer->thread_id);
+#endif
     if (timer->thread == NULL) {
       AUBIO_ERR( "Couldn't create timer thread");     
       AUBIO_FREE(timer);
       return NULL;
     }
+#if 0
     SetThreadPriority(timer->thread, THREAD_PRIORITY_TIME_CRITICAL);
+#endif
   } else {
     aubio_timer_run((LPVOID) timer); 
   }
@@ -89,6 +94,7 @@
 DWORD WINAPI 
 aubio_timer_run(LPVOID data)
 {
+#if 0
   int count = 0;
   int cont = 1;
   long start;
@@ -130,6 +136,7 @@
   }
 
   ExitThread(0);
+#endif
   return 0;
 }
 
@@ -145,6 +152,7 @@
 int 
 aubio_timer_join(aubio_timer_t* timer)
 {
+#if 0
   DWORD wait_result;
   if (timer->thread == 0) {
     return AUBIO_OK;
@@ -151,6 +159,9 @@
   }
   wait_result = WaitForSingleObject(timer->thread, INFINITE);
   return (wait_result == WAIT_OBJECT_0)? AUBIO_OK : AUBIO_FAIL;
+#else
+  return 0;
+#endif
 }
 /***************************************************************
  *
@@ -176,9 +187,13 @@
 
 double rdtsc(void)
 {
+#if 0
   LARGE_INTEGER t;
   QueryPerformanceCounter(&t);
   return (double) t.QuadPart;
+#else
+  return 0.;
+#endif
 }
 
 double aubio_estimate_cpu_frequency(void)
@@ -209,6 +224,7 @@
   return freq;
 
 #else
+#if 0
   unsigned int before, after;
   LARGE_INTEGER start, stop;
 
@@ -222,9 +238,10 @@
 
   return (double) 1000 * (stop.QuadPart - start.QuadPart) / (after - before);
 #endif
+  return 0;
+#endif
 }
 
-#endif
 
 
 #elif defined(MACOS9)