diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index bc69002cce..fe074e9b45 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -22,12 +22,6 @@ #include #include -#if defined(__CYGWIN__) || defined(__CYGWIN64__) -#include -#include -#include -#endif - #include #include #include @@ -561,18 +555,21 @@ float Aircraft::rangefinder_range() const return altitude; } +#if defined(__CYGWIN__) || defined(__CYGWIN64__) +extern "C" { uint32_t timeGetTime(); } +#endif // potentially replace this with a call to AP_HAL::Util::get_hw_rtc uint64_t Aircraft::get_wall_time_us() const { #if defined(__CYGWIN__) || defined(__CYGWIN64__) - static DWORD tPrev; + static uint32_t tPrev; static uint64_t last_ret_us; if (tPrev == 0) { tPrev = timeGetTime(); return 0; } - DWORD now = timeGetTime(); + uint32_t now = timeGetTime(); last_ret_us += (uint64_t)((now - tPrev)*1000UL); tPrev = now; return last_ret_us;