Index: runtime/lib/integers.cc |
=================================================================== |
--- runtime/lib/integers.cc (revision 21753) |
+++ runtime/lib/integers.cc (working copy) |
@@ -180,7 +180,12 @@ |
return Bool::Get(left.CompareWith(right) == 0); |
} |
+// Windows does not have strtoll defined. |
+#if defined(_MSC_VER) |
+#define strtoll _strtoi64 |
+#endif |
siva
2013/04/19 20:04:36
Could you move this to platform/c99_support_win.h
srdjan
2013/04/19 20:06:53
Done.
|
+ |
DEFINE_NATIVE_ENTRY(Integer_parse, 1) { |
GET_NON_NULL_NATIVE_ARGUMENT(String, value, arguments->NativeArgAt(0)); |
if (value.IsOneByteString()) { |
@@ -193,10 +198,10 @@ |
// a) '+5' is not a valid integer (leading plus). |
if (cstr[0] != '+') { |
char* p_end = NULL; |
- const int64_t int_value = strtol(cstr, &p_end, 10); |
+ const int64_t int_value = strtoll(cstr, &p_end, 10); |
if (p_end == (cstr + len)) { |
- if ((Smi::kMinValue <= int_value) && (int_value <= Smi::kMaxValue)) { |
- return Smi::New(int_value); |
+ if ((int_value != LLONG_MIN) && (int_value != LLONG_MAX)) { |
+ return Integer::New(int_value); |
} |
} |
} |