From 2d30a9e6fa5f7a328c942fe7b0b68908339c9076 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 29 Jun 2002 00:10:05 +0000 Subject: Small changes to make Metrowerks CodeWarrior for Windows work. See seperate posting with CodeWarrior project file. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2334 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/forms_timer.cxx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/forms_timer.cxx') diff --git a/src/forms_timer.cxx b/src/forms_timer.cxx index d1ee76388..983095e1f 100644 --- a/src/forms_timer.cxx +++ b/src/forms_timer.cxx @@ -1,5 +1,5 @@ // -// "$Id: forms_timer.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $" +// "$Id: forms_timer.cxx,v 1.4.2.3.2.2 2002/06/29 00:10:04 matthiaswm Exp $" // // Forms timer object for the Fast Light Tool Kit (FLTK). // @@ -31,8 +31,12 @@ #include #include #ifdef WIN32 -# include -# include +# ifdef __MWERKS__ +# include +# else +# include +# include +# endif #else # include #endif @@ -42,10 +46,17 @@ void fl_gettime(long* sec, long* usec) { #ifdef WIN32 +# ifdef __MWERKS__ + time_t localTime = time(NULL); + struct tm *now = localtime(&localTime); + *sec = now->tm_sec + 60*now->tm_min + 3600*now->tm_hour + 24*3600*now->tm_yday; + *usec = 0; +# else struct timeb tp; ftime(&tp); *sec = tp.time; *usec = tp.millitm * 1000; +# endif #else struct timeval tp; struct timezone tzp; @@ -150,5 +161,5 @@ void Fl_Timer::suspended(char d) { } // -// End of "$Id: forms_timer.cxx,v 1.4.2.3.2.1 2002/01/01 15:11:32 easysw Exp $". +// End of "$Id: forms_timer.cxx,v 1.4.2.3.2.2 2002/06/29 00:10:04 matthiaswm Exp $". // -- cgit v1.2.3