aboutsummaryrefslogtreecommitdiff
path: root/exciter
diff options
context:
space:
mode:
authorcarmen rocco <ix9@users.sourceforge.net>2004-05-30 05:20:01 +0000
committercarmen rocco <ix9@users.sourceforge.net>2004-05-30 05:20:01 +0000
commit18230ab52e858c7cb21b7685cff05f05bd9d864e (patch)
tree00fca92c94560bb891b85894bf0b686a9f8eb8da /exciter
parente9edaae480da9644c4377bd6eaa8d940ee17e4e2 (diff)
trying out the roast of these NT Tweak .
svn path=/trunk/externals/unauthorized/; revision=1793
Diffstat (limited to 'exciter')
-rw-r--r--exciter/exciter.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/exciter/exciter.c b/exciter/exciter.c
index 0faf3d4..16c584f 100644
--- a/exciter/exciter.c
+++ b/exciter/exciter.c
@@ -37,8 +37,6 @@
#include <math.h>
#include <ctype.h>
#include <time.h>
-#include <sys/time.h>
-
#include <m_pd.h>
#include "m_imp.h"
@@ -48,7 +46,10 @@
#ifdef NT
#include <io.h>
+#include <winsock2.h>
+#include <sys/timeb.h>
#else
+#include <sys/time.h>
#include <unistd.h>
#endif
@@ -687,16 +688,27 @@ static t_int *exciter_perform(t_int *w)
t_int ei, gi;
t_int gstart, gend;
t_exciter* x = (t_exciter*)(w[1]);
+#ifdef NT
+ time_t et;
+ struct _timeb tv;
+#else
struct timeval tv;
struct timezone tz;
+#endif
long long looptime = 0L;
double preltime = x->x_reltime;
if ( x->x_started )
{
// get current time in ms
- gettimeofday( &tv, &tz );
- looptime = tv.tv_sec*1000 + tv.tv_usec/1000;
+#ifdef NT
+ time( &et );
+ _ftime( &tv );
+ looptime = et*1000 + tv.millitm;
+#else
+ gettimeofday( &tv, &tz );
+ looptime = tv.tv_sec*1000 + tv.tv_usec/1000;
+#endif
if ( x->x_plooptime == 0L )
{
x->x_plooptime = looptime;