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.
This commit is contained in:
stijn
2020-09-10 12:22:49 +02:00
committed by Damien George
parent 373b400632
commit 4b35aa5730
2 changed files with 3 additions and 3 deletions

View File

@@ -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