Skip to content

Commit 30cfa2f

Browse files
committed
Fixed up windows compilation
1 parent e8d03b7 commit 30cfa2f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

v8py/context.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,20 @@ PyObject *context_async_call(context_c *self, PyObject *args, PyObject *kwargs)
212212
int argc = PyTuple_GET_SIZE(call_args);
213213
MaybeLocal<Value> result;
214214

215+
#ifndef _WIN32
215216
if (argc <= 16) {
216217
Local<Value> argv[argc];
217218
jss_from_pys(call_args, argv, context);
218219
result = object->CallAsFunction(context, js_this, argc, argv);
219220
} else {
221+
#endif
220222
Local<Value> *argv = new Local<Value>[argc];
221223
jss_from_pys(call_args, argv, context);
222224
result = object->CallAsFunction(context, js_this, argc, argv);
223225
delete[] argv;
226+
#ifndef _WIN32
224227
}
228+
#endif
225229

226230
PY_PROPAGATE_JS;
227231

@@ -322,7 +326,7 @@ PyObject *context_bind_py_function(context_c *self, PyObject *args) {
322326
PyObject *py_function_args = PyTuple_GetSlice(args, 1, argc);
323327

324328
int py_argc = (int)PyTuple_GET_SIZE(py_function_args);
325-
Local<Value> argv[py_argc + 1];
329+
Local<Value> *argv = new Local<Value>[py_argc + 1];
326330
argv[0] = Null(isolate);
327331
jss_from_pys(py_function_args, &argv[1], context);
328332

@@ -331,6 +335,7 @@ PyObject *context_bind_py_function(context_c *self, PyObject *args) {
331335

332336
// use a hack to do the javascript "currying" converted_function.bind(null, py_function_args)
333337
Local<Function> bound_function = bind_function(self, context, py_argc + 1, argv, converted_function);
338+
delete[] argv;
334339

335340
// release the arguments
336341
Py_DECREF(py_function_args);

0 commit comments

Comments
 (0)