2014-06-30 22:15:26 +00:00
|
|
|
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2016-10-26 07:26:03 +00:00
|
|
|
#ifndef RUNTIME_PLATFORM_MATH_H_
|
|
|
|
#define RUNTIME_PLATFORM_MATH_H_
|
2014-06-30 22:15:26 +00:00
|
|
|
|
|
|
|
// We must take these math functions from the C++ header file as long as we
|
|
|
|
// are using the STL. Otherwise the Android build will break due to confusion
|
|
|
|
// between C++ and C headers when math.h is also included.
|
2017-03-15 20:11:05 +00:00
|
|
|
#if !defined(HOST_OS_FUCHSIA)
|
2014-06-30 22:15:26 +00:00
|
|
|
#include <cmath>
|
|
|
|
|
|
|
|
#define isinf(val) std::isinf(val)
|
|
|
|
#define isnan(val) std::isnan(val)
|
|
|
|
#define signbit(val) std::signbit(val)
|
|
|
|
#define isfinite(val) std::isfinite(val)
|
2016-07-01 19:42:05 +00:00
|
|
|
#else
|
|
|
|
// TODO(zra): When Fuchsia has STL, do the same thing as above.
|
|
|
|
#include <math.h>
|
|
|
|
#endif
|
2014-06-30 22:15:26 +00:00
|
|
|
|
2016-10-26 07:26:03 +00:00
|
|
|
#endif // RUNTIME_PLATFORM_MATH_H_
|