diff --git a/quickjs.h b/quickjs.h index bb5f85a..9fb40a7 100644 --- a/quickjs.h +++ b/quickjs.h @@ -516,7 +516,7 @@ static js_force_inline JSValue JS_NewInt64(JSContext *ctx, int64_t val) static js_force_inline JSValue JS_NewUint32(JSContext *ctx, uint32_t val) { JSValue v; - if (val <= 0x7fffffff) { + if (val <= INT32_MAX) { v = JS_NewInt32(ctx, (int32_t)val); } else { v = JS_NewFloat64(ctx, (double)val);