#define clock_Init()
#define clock_NewTime()
#define clock_UpdateTime()
-#define clock_GetTime(cv) (gettimeofday((struct timeval *)cv, NULL))
#define clock_Sec() (time(NULL))
#define clock_haveCurrentTime 1
+
+#define clock_GetTime(cv) \
+ BEGIN \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ (cv)->sec = (afs_int32)tv.tv_sec; \
+ (cv)->usec = (afs_int32)tv.tv_usec; \
+ END
+
#else /* AFS_USE_GETTIMEOFDAY || AFS_PTHREAD_ENV */
/* For internal use. The last value returned from clock_GetTime() */
extern void clock_UpdateTime();
/* Return the current clock time. If the clock value has not been updated since the last call to clock_NewTime, it is updated now */
-#define clock_GetTime(cv) \
- BEGIN \
- if (!clock_haveCurrentTime) clock_UpdateTime(); \
- (cv)->sec = clock_now.sec; \
- (cv)->usec = clock_now.usec; \
+#define clock_GetTime(cv) \
+ BEGIN \
+ if (!clock_haveCurrentTime) clock_UpdateTime(); \
+ (cv)->sec = clock_now.sec; \
+ (cv)->usec = clock_now.usec; \
END
/* Current clock time, truncated to seconds */