Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Unified Diff: runtime/lib/double.cc

Issue 353403004: Fixes Android build by using C++ math header instead of C one. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/platform/c99_support_win.h » ('j') | runtime/vm/simulator_arm64.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/double.cc
===================================================================
--- runtime/lib/double.cc (revision 37827)
+++ runtime/lib/double.cc (working copy)
@@ -2,7 +2,7 @@
// 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.
-#include <math.h>
+#include <cmath>
#include "vm/bootstrap_natives.h"
@@ -73,7 +73,7 @@
static RawInteger* DoubleToInteger(double val, const char* error_msg) {
- if (isinf(val) || isnan(val)) {
+ if (std::isinf(val) || std::isnan(val)) {
const Array& args = Array::Handle(Array::New(1));
args.SetAt(0, String::Handle(String::New(error_msg)));
Exceptions::ThrowByType(Exceptions::kUnsupported, args);
@@ -258,13 +258,13 @@
DEFINE_NATIVE_ENTRY(Double_getIsInfinite, 1) {
const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0));
- return Bool::Get(isinf(arg.value())).raw();
+ return Bool::Get(std::isinf(arg.value())).raw();
}
DEFINE_NATIVE_ENTRY(Double_getIsNaN, 1) {
const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0));
- return Bool::Get(isnan(arg.value())).raw();
+ return Bool::Get(std::isnan(arg.value())).raw();
}
@@ -272,7 +272,7 @@
const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0));
// Include negative zero, infinity.
double dval = arg.value();
- return Bool::Get(signbit(dval) && !isnan(dval)).raw();
+ return Bool::Get(std::signbit(dval) && !std::isnan(dval)).raw();
}
// Add here only functions using/referring to old-style casts.
« no previous file with comments | « no previous file | runtime/platform/c99_support_win.h » ('j') | runtime/vm/simulator_arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698