diff --git a/libraries/AP_HAL_SITL/Scheduler.cpp b/libraries/AP_HAL_SITL/Scheduler.cpp index 748ac7a229..3d9b4efaf9 100644 --- a/libraries/AP_HAL_SITL/Scheduler.cpp +++ b/libraries/AP_HAL_SITL/Scheduler.cpp @@ -9,7 +9,6 @@ #include #include #include -#include "fenv_polyfill.h" using namespace HALSITL; diff --git a/libraries/AP_HAL_SITL/fenv_polyfill.h b/libraries/AP_HAL_SITL/fenv_polyfill.h deleted file mode 100644 index 6c3ef1be71..0000000000 --- a/libraries/AP_HAL_SITL/fenv_polyfill.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#if (defined __APPLE__) && (defined(__i386__) || defined(__x86_64__)) - -#include - -// Public domain polyfill for feenableexcept on OS X -// http://www-personal.umich.edu/~williams/archive/computation/fe-handling-example.c - -inline int -feenableexcept (unsigned int excepts) -{ - static fenv_t fenv; - unsigned int new_excepts = excepts & FE_ALL_EXCEPT, - old_excepts; // previous masks - - if ( fegetenv (&fenv) ) return -1; - old_excepts = fenv.__control & FE_ALL_EXCEPT; - - // unmask - fenv.__control &= ~new_excepts; - fenv.__mxcsr &= ~(new_excepts << 7); - - return ( fesetenv (&fenv) ? -1 : old_excepts ); -} - -#endif // APPLE