Skip to content

Commit

Permalink
Fix compilation on Windows with VS 2017
Browse files Browse the repository at this point in the history
Remove usage of variable length array to fix compilation on Windows

Fix #93
  • Loading branch information
uglide committed Jun 19, 2019
1 parent 40194fa commit 7848516
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qpython_priv.cpp
Expand Up @@ -519,10 +519,11 @@ QPythonPriv::QPythonPriv()

// Initialize sys.argv (https://github.com/thp/pyotherside/issues/77)
int argc = 1;
wchar_t *argv[argc];
wchar_t **argv = (wchar_t **)malloc(argc * sizeof(wchar_t *));
argv[0] = Py_DecodeLocale("", nullptr);
PySys_SetArgvEx(argc, argv, 0);
PyMem_RawFree((void *)argv[0]);
free(argv);

locals = PyObjectRef(PyDict_New(), true);
assert(locals);
Expand Down

0 comments on commit 7848516

Please sign in to comment.