mirror of
https://github.com/encounter/SDL.git
synced 2025-12-21 10:49:12 +00:00
Fixed bug 3262 - Premake scripts are not compatible with "Genie" (premake fork)
jfverdon Genie (https://github.com/bkaradzic/genie) is a well known premake fork which uses internally Lua 5.3 (as opposed to version 5.1 used in premake4). As there is some Lua's API breaks in Lua 5.2, SDL premake scripts do not works with premake. The two incompatibilities I noticed were: * unhandle modes "rt" and "wt" for io.open. Has io.open opens files in text mode by default, the "t" flag is not needed (this flag is not supported in Genie). * os.execute signature change, the return value is a tuple from Lua 5.2, before it was just the called program exit code.
This commit is contained in:
@@ -33,8 +33,8 @@ local insertLocation
|
||||
-- This function begins config header generation given the name of the generated
|
||||
-- file and the name of the template file to use.
|
||||
function startGeneration(file, template)
|
||||
configFile = fileopen(file, "wt")
|
||||
templateFileContents = readfile(template, "rt")
|
||||
configFile = fileopen(file, "w")
|
||||
templateFileContents = readfile(template, "r")
|
||||
insertLocation = templateFileContents:find(searchKey)
|
||||
if insertLocation then
|
||||
configFile:write(templateFileContents:sub(1, insertLocation - 1))
|
||||
|
||||
Reference in New Issue
Block a user