Windows MSVC port
Extend the windows port so it compiles with the toolchain from Visual Studio 2013
diff --git a/py/runtime.c b/py/runtime.c
index a5a5bc5..7a701fe 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <alloca.h>
#include "mpconfig.h"
#include "nlr.h"
@@ -1074,11 +1075,12 @@
uint pkg_name_len;
const char *pkg_name = mp_obj_str_get_data(dest[0], &pkg_name_len);
- char dot_name[pkg_name_len + 1 + qstr_len(name)];
+ const uint dot_name_len = pkg_name_len + 1 + qstr_len(name);
+ char *dot_name = alloca(dot_name_len);
memcpy(dot_name, pkg_name, pkg_name_len);
dot_name[pkg_name_len] = '.';
memcpy(dot_name + pkg_name_len + 1, qstr_str(name), qstr_len(name));
- qstr dot_name_q = qstr_from_strn(dot_name, sizeof(dot_name));
+ qstr dot_name_q = qstr_from_strn(dot_name, dot_name_len);
mp_obj_t args[5];
args[0] = MP_OBJ_NEW_QSTR(dot_name_q);