diff options
author | Edwin Mons <edwin.mons@isode.com> | 2014-10-17 10:06:17 (GMT) |
---|---|---|
committer | Edwin Mons <edwin.mons@isode.com> | 2014-10-17 10:39:46 (GMT) |
commit | 0e7940bf2ede0147ee1eafced53bc9ad08a4015e (patch) | |
tree | 6295f5e8054f7f7212fc66ab83001c8d82821995 | |
parent | c02aedbe59a3abc2a7b84b7e1a8bf3a7f11ee20f (diff) | |
download | swift-contrib-0e7940bf2ede0147ee1eafced53bc9ad08a4015e.zip swift-contrib-0e7940bf2ede0147ee1eafced53bc9ad08a4015e.tar.bz2 |
Make core.c generation compatible with Python 2.4
generate_embedded_lua in Sluift/SConscript used a bytearray, which wasn't
available until Python 2.6. Modified the code to use the string data
instead of a bytearray.
Test-information:
Builds on OS X 10.9 and CentOS 5.9
sluift binary works on both platforms
Change-Id: Iae29f76e32c8b7a827bc438caf09457b259446ca
-rw-r--r-- | Sluift/SConscript | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Sluift/SConscript b/Sluift/SConscript index 5e0a030..a2b6748 100644 --- a/Sluift/SConscript +++ b/Sluift/SConscript @@ -72,11 +72,10 @@ elif env["SCONS_STAGE"] == "build" : f = open(source[0].abspath, "r") data = f.read() f.close() - data_bytes = bytearray(data) f = open(target[0].abspath, "w") f.write('#include <stddef.h>\n') - f.write('const size_t ' + source[0].name.replace(".", "_") + "_size = " + str(len(data_bytes)) + ";\n") - f.write('const char ' + source[0].name.replace(".", "_") + "[] = {" + ", ".join([str(b) for b in data_bytes]) + "};\n") + f.write('const size_t ' + source[0].name.replace(".", "_") + "_size = " + str(len(data)) + ";\n") + f.write('const char ' + source[0].name.replace(".", "_") + "[] = {" + ", ".join([str(ord(c)) for c in data]) + "};\n") f.close() sluift_env.Command("core.c", ["core.lua"], env.Action(generate_embedded_lua, cmdstr="$GENCOMSTR")) |