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