X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=os%2Fhptime.c;h=b93712baf44794db2b74b45548e710e72222dd0b;hb=17dbfa90b14431b6b3343486c0062e22dd457826;hp=3f223c634d099d0684ba240faa66cc50716646fc;hpb=96f0ef786b54356c56cc3d4e4f0838df2505cfcc;p=bertos.git diff --git a/os/hptime.c b/os/hptime.c old mode 100755 new mode 100644 index 3f223c63..b93712ba --- a/os/hptime.c +++ b/os/hptime.c @@ -1,8 +1,33 @@ -/*! +/** * \file * * * \brief Portable abstraction for high-resolution time handling (implementation) @@ -11,16 +36,6 @@ * \author Bernardo Innocenti */ -/* - * $Log$ - * 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) @@ -44,15 +59,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 +#include /* for gettimeofday() */ +#include /* 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; }