diff options
-rw-r--r-- | src/time.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -25,6 +25,7 @@ #include <mach/clock.h> #include <mach/mach_time.h> #elif defined(__amigaos4__) +#include <assert.h> #include <proto/timer.h> #else #include <sys/time.h> @@ -57,17 +58,15 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out) current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000); #elif defined(__amigaos4__) - struct TimeVal tv; + struct TimeVal tv; - /* NB: The calling task must already have opened timer.device - * and obtained the interface. - */ - if (ITimer != NULL) { - ITimer->GetUpTime(&tv); - current = (tv.Seconds * 1000) + (tv.Microseconds / 1000); - } else { - current = 0; /* \todo should we be opening timer.device, or printing a warning? */ - } + /* NB: The calling task must already have opened timer.device + * and obtained the interface. + */ + assert(ITimer != NULL); + + ITimer->GetUpTime(&tv); + current = (tv.Seconds * 1000) + (tv.Microseconds / 1000); #else #warning "Using dodgy gettimeofday() fallback" /** \todo Implement this properly! */ |