From 784851668baaf9a1bedca1643b2f6a6d3ddaf674 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Wed, 19 Jun 2019 11:37:34 +0300 Subject: [PATCH] Fix compilation on Windows with VS 2017 Remove usage of variable length array to fix compilation on Windows Fix #93 --- src/qpython_priv.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qpython_priv.cpp b/src/qpython_priv.cpp index 96cd518..8b4f879 100644 --- a/src/qpython_priv.cpp +++ b/src/qpython_priv.cpp @@ -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);