X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Futil%2Fu_time.h;h=29fd1cbc67d5a69d19e43ad179ac110b8cbad35c;hb=5460da543608805a3debbb401ccc19442e1cb476;hp=7a5c54d9b235059dfee71c8a91464290959b0622;hpb=1e355a0cb36f206e681d1098b425ac541bc80840;p=mesa.git diff --git a/src/gallium/auxiliary/util/u_time.h b/src/gallium/auxiliary/util/u_time.h index 7a5c54d9b23..29fd1cbc67d 100644 --- a/src/gallium/auxiliary/util/u_time.h +++ b/src/gallium/auxiliary/util/u_time.h @@ -43,6 +43,11 @@ #include /* usleep */ #endif +#if defined(PIPE_OS_HAIKU) +#include /* timeval */ +#include +#endif + #include "pipe/p_compiler.h" @@ -58,7 +63,7 @@ extern "C" { */ struct util_time { -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) struct timeval tv; #else int64_t counter; @@ -69,14 +74,23 @@ struct util_time void util_time_get(struct util_time *t); +/** + * Return t2 = t1 + usecs + */ void util_time_add(const struct util_time *t1, int64_t usecs, struct util_time *t2); +/** + * Return current time in microseconds + */ uint64_t util_time_micros( void ); +/** + * Return difference between times, in microseconds + */ int64_t util_time_diff(const struct util_time *t1, const struct util_time *t2); @@ -89,7 +103,7 @@ util_time_timeout(const struct util_time *start, const struct util_time *end, const struct util_time *curr); -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) #define util_time_sleep usleep #else void