catch_polyfills.cpp 653 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Created by Martin on 17/11/2017.
  3. *
  4. * Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #include "catch_polyfills.hpp"
  8. #include <cmath>
  9. namespace Catch {
  10. #if !defined(CATCH_CONFIG_POLYFILL_ISNAN)
  11. bool isnan(float f) {
  12. return std::isnan(f);
  13. }
  14. bool isnan(double d) {
  15. return std::isnan(d);
  16. }
  17. #else
  18. // For now we only use this for embarcadero
  19. bool isnan(float f) {
  20. return std::_isnan(f);
  21. }
  22. bool isnan(double d) {
  23. return std::_isnan(d);
  24. }
  25. #endif
  26. } // end namespace Catch