Explorar o código

Undefine min/max macros

Stefan Siegl %!s(int64=10) %!d(string=hai) anos
pai
achega
5b736a6e92
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      v8js_convert.cc

+ 4 - 0
v8js_convert.cc

@@ -1093,6 +1093,10 @@ v8::Handle<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC)
 
 		case IS_LONG:
 		    v = Z_LVAL_P(value);
+			/* On Windows there are max and min macros, which would clobber the
+			 * method names of std::numeric_limits< > otherwise. */
+#undef max
+#undef min
 			if (v < - std::numeric_limits<int32_t>::min() || v > std::numeric_limits<int32_t>::max()) {
 				jsValue = V8JS_FLOAT((double)v);
 			} else {