]>
Commit | Line | Data |
---|---|---|
3b02ab23 JB |
1 | --- glide3x-20010309/swlibs/fxmisc/fxos.c.orig 2013-09-23 21:06:22.480951884 +0200 |
2 | +++ glide3x-20010309/swlibs/fxmisc/fxos.c 2013-09-23 21:10:39.596235960 +0200 | |
3 | @@ -43,13 +43,21 @@ | |
4 | #include <fxos.h> | |
5 | #endif | |
6 | #if !macintosh | |
7 | +#if defined ( __sparc__ ) || defined ( __DJGPP__ ) | |
8 | +# include <sys/types.h> | |
9 | +# include <sys/timeb.h> | |
10 | +#elif defined ( WIN32 ) || ( __DOS__ ) | |
11 | +# include <time.h> | |
12 | +#else | |
13 | +# include <sys/types.h> | |
14 | +# include <sys/times.h> | |
15 | +# include <sys/param.h> | |
16 | +#endif | |
17 | /* return current time in seconds (floating point) */ | |
18 | float fxTime(void) | |
19 | { | |
20 | #if defined ( __sparc__ ) || defined ( __DJGPP__ ) | |
21 | /* times returns 0 in BSD Unix, so we use ftime instead */ | |
22 | -# include <sys/types.h> | |
23 | -# include <sys/timeb.h> | |
24 | struct timeb tb; | |
25 | static time_t once; // saves first time value | |
26 | ||
27 | @@ -60,13 +68,9 @@ | |
28 | ||
29 | #else | |
30 | #if defined ( WIN32 ) || ( __DOS__ ) | |
31 | -# include <time.h> | |
32 | # define times(a) clock() | |
33 | # define HZ CLOCKS_PER_SEC | |
34 | #else | |
35 | -# include <sys/types.h> | |
36 | -# include <sys/times.h> | |
37 | -# include <sys/param.h> | |
38 | struct tms foo; | |
39 | #endif | |
40 | return times(&foo)/(float)HZ; |