Add rotating hash init function.
[bertos.git] / os / hptime.c
index 7c53d9dfb959f95a4516dcd3c36a8019eac2f40c..771832307efe1493b58a327ef4541ccf1132070d 100755 (executable)
@@ -1,4 +1,4 @@
-/*!
+/**
  * \file
  * <!--
  * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
  * \author Bernardo Innocenti <bernie@develer.com>
  */
 
-/*#*
- *#* $Log$
- *#* Revision 1.5  2005/11/04 16:20:02  bernie
- *#* Fix reference to README.devlib in header.
- *#*
- *#* Revision 1.4  2004/08/25 14:12:09  rasky
- *#* Aggiornato il comment block dei log RCS
- *#*
- *#* Revision 1.3  2004/08/10 05:45:04  bernie
- *#* Fix spacing in header.
- *#*
- *#* Revision 1.2  2004/06/03 11:27:09  bernie
- *#* Add dual-license information.
- *#*
- *#* Revision 1.1  2004/06/03 09:01:06  bernie
- *#* Import into DevLib.
- *#*
- *#*/
-
 #include "hptime.h"
 
 #if defined(_WIN32)
@@ -53,15 +34,16 @@ hptime_t hptime_get(void)
        return (((hptime_t)ft.dwHighDateTime) << 32) + (hptime_t)ft.dwLowDateTime;
 }
 
-#elif defined(__unix__)
+#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
 
-#include <sys/time.h>
+#include <sys/time.h> /* for gettimeofday() */
+#include <stddef.h> /* for NULL */
 
 hptime_t hptime_get(void)
 {
        struct timeval tv;
 
-       gettimeofday(&tv, 0);
+       gettimeofday(&tv, NULL);
        return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND
                + (hptime_t)tv.tv_usec;
 }