Remove a remnant of the old non-licensing.
[open-adventure.git] / datime.c
1 #ifdef AMIGA
2 #define _TIME_
3 #include "exec/types.h"
4 #include "intuition/intuition.h"
5
6 #define INTUITIONREV 1
7
8 struct IntuitionBase *IntuitionBase = NULL;
9
10 fDATIME(X,Y)int *X, *Y; {
11 static int GOTX = 0, GOTY;
12         if(GOTX == 0) {
13                 IntuitionBase = (struct IntuitionBase *)
14                         OpenLibrary("intuition.library", INTUITIONREV);
15                 if (IntuitionBase == NULL) {
16                         printf("Can't open library.\n");
17                         exit(FALSE);
18                         }
19                 CurrentTime(&GOTX, &GOTY);
20                 CloseLibrary(IntuitionBase);
21                 }
22         GOTY += 654321;
23         if(GOTY >= 1000000) {GOTX += 1; GOTY -= 1000000;}
24         *X = GOTX;
25         *Y = GOTY;
26 }
27 #endif
28
29 #ifdef __MSDOS__
30 #define _TIME_
31 #include "time.h"
32
33 fDATIME(long *X,long *Y) {
34         time(X); time(Y);
35         *Y /= 2;
36         /* it would be even better if the two numbers were totally
37          * unrelated, like if 'time' returned 64 bits of data */
38 }
39 #endif
40
41 #ifndef _TIME_
42 #include "sys/time.h"
43
44 void fDATIME(long *X, long *Y) {
45         struct timeval now;
46         gettimeofday(&now, 0);
47         *X = now.tv_sec;
48         *Y = now.tv_usec;
49 }
50 #endif