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

Unified Diff: src/preparser.cc

Issue 14362023: Replace math.h with cmath (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 7 years, 8 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 | « src/platform-win32.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 6e8800e019aeafca8434af95a0c47e52e56202f2..3bf88cad352935a342a24bf2e1e76563649539a8 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <math.h>
+#include <cmath>
#include "../include/v8stdint.h"
@@ -42,14 +42,18 @@
#include "unicode.h"
#include "utils.h"
-namespace v8 {
-
#ifdef _MSC_VER
+namespace std {
+
// Usually defined in math.h, but not in MSVC.
// Abstracted to work
int isfinite(double value);
+
+} // namespace std
#endif
+namespace v8 {
+
namespace preparser {
PreParser::PreParseResult PreParser::PreParseLazyFunction(
@@ -1712,7 +1716,7 @@ int DuplicateFinder::AddNumber(i::Vector<const char> key, int value) {
double double_value = StringToDouble(unicode_constants_, key, flags, 0.0);
int length;
const char* string;
- if (!isfinite(double_value)) {
+ if (!std::isfinite(double_value)) {
string = "Infinity";
length = 8; // strlen("Infinity");
} else {
« no previous file with comments | « src/platform-win32.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698