summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-09-10 12:22:49 +0200
committerDamien George <damien@micropython.org>2020-09-11 10:51:55 +1000
commit4b35aa5730cf26992453e3ce7cf74ced4128fe20 (patch)
tree3873889ae84886b70d778c1dc26d38b8962449b5
parent373b400632bb5371f1e259983850814d2384e667 (diff)
tools: Write msvc-compatible frozen content.
The msvc compiler doesn't accept zero-sized arrays so let the freezing process generate compatible C code in case no modules are found and the involved arrays are all empty. This doesn't affect the functionality in any way because those arrays only get accessed when mp_frozen_mpy_names contains names, i.e. when modules are actually found.
-rwxr-xr-xtools/make-frozen.py4
-rw-r--r--tools/makemanifest.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/make-frozen.py b/tools/make-frozen.py
index a8706bf78..bc35d3834 100755
--- a/tools/make-frozen.py
+++ b/tools/make-frozen.py
@@ -50,7 +50,7 @@ print("const uint32_t mp_frozen_str_sizes[] = {")
for f, st in modules:
print("%d," % st.st_size)
-print("};")
+print("0};")
print("const char mp_frozen_str_content[] = {")
for f, st in modules:
@@ -82,4 +82,4 @@ for f, st in modules:
chrs.append('\\0"')
print("".join(chrs))
-print("};")
+print('"\\0"};')
diff --git a/tools/makemanifest.py b/tools/makemanifest.py
index 377f24559..9ef036826 100644
--- a/tools/makemanifest.py
+++ b/tools/makemanifest.py
@@ -327,7 +327,7 @@ def main():
b" (qstr_pool_t*)&mp_qstr_const_pool, MP_QSTRnumber_of, 0, 0\n"
b"};\n"
b'const char mp_frozen_mpy_names[1] = {"\\0"};\n'
- b"const mp_raw_code_t *const mp_frozen_mpy_content[0] = {};\n"
+ b"const mp_raw_code_t *const mp_frozen_mpy_content[1] = {NULL};\n"
)
# Generate output