diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2002-06-29 00:10:05 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2002-06-29 00:10:05 +0000 |
| commit | 2d30a9e6fa5f7a328c942fe7b0b68908339c9076 (patch) | |
| tree | 0727ed8801c736d52d6b8cf2ea7cb282af99f3ff /src/forms_timer.cxx | |
| parent | fb54e063066c11bfe8d4918bd68453c3b64a68db (diff) | |
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
Diffstat (limited to 'src/forms_timer.cxx')
| -rw-r--r-- | src/forms_timer.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
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 <FL/Fl_Timer.H> #include <FL/fl_draw.H> #ifdef WIN32 -# include <sys/types.h> -# include <sys/timeb.h> +# ifdef __MWERKS__ +# include <time.h> +# else +# include <sys/types.h> +# include <sys/timeb.h> +# endif #else # include <sys/time.h> #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 $". // |
