0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 18:41:52 +00:00

fix long vs. zend_long issue on Windows, refs #292

This commit is contained in:
Stefan Siegl 2017-03-08 07:38:42 +01:00
parent a9bdc32125
commit e86c957811

View File

@ -101,7 +101,7 @@ static v8::Handle<v8::Value> v8js_hash_to_jsarr(zval *value, v8::Isolate *isolat
v8::Handle<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ v8::Handle<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */
{ {
v8::Handle<v8::Value> jsValue; v8::Handle<v8::Value> jsValue;
long v; zend_long v;
zend_class_entry *ce; zend_class_entry *ce;
switch (Z_TYPE_P(value)) switch (Z_TYPE_P(value))
@ -143,9 +143,9 @@ v8::Handle<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC)
#undef max #undef max
#undef min #undef min
if (v < - std::numeric_limits<int32_t>::min() || v > std::numeric_limits<int32_t>::max()) { if (v < - std::numeric_limits<int32_t>::min() || v > std::numeric_limits<int32_t>::max()) {
jsValue = V8JS_FLOAT((double)v); jsValue = V8JS_FLOAT(static_cast<double>(v));
} else { } else {
jsValue = V8JS_INT(v); jsValue = V8JS_INT(static_cast<int32_t>(v));
} }
break; break;