Move pf_is_compressed() to u_format auxiliary module.
[mesa.git] / src / gallium / auxiliary / util / u_time.h
index 48ec7a4a963d4fa89a5db30846c7525afe6eee07..a6189a247bbdea8d3197898e937d1d25e3eb896a 100644 (file)
 
 #include "pipe/p_config.h"
 
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE)
 #include <time.h> /* timeval */
 #include <unistd.h> /* usleep */
 #endif
 
+#if defined(PIPE_OS_HAIKU)
+#include <sys/time.h> /* timeval */
+#include <unistd.h>
+#endif
+
 #include "pipe/p_compiler.h"
 
 
@@ -58,10 +63,10 @@ extern "C" {
  */
 struct util_time 
 {
-#if defined(PIPE_OS_LINUX)
+#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
-   long long counter;
+   int64_t counter;
 #endif
 };
    
@@ -74,6 +79,9 @@ util_time_add(const struct util_time *t1,
               int64_t usecs,
               struct util_time *t2);
 
+uint64_t
+util_time_micros( void );
+
 int64_t
 util_time_diff(const struct util_time *t1, 
                const struct util_time *t2);
@@ -86,7 +94,7 @@ util_time_timeout(const struct util_time *start,
                   const struct util_time *end,
                   const struct util_time *curr);
 
-#if defined(PIPE_OS_LINUX)
+#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