mirror of https://github.com/libsdl-org/SDL
Fixed parsing symbols from SDL_oldnames.h
This commit is contained in:
parent
e76c1d74bc
commit
566a559beb
|
@ -55,14 +55,21 @@ def get_all_replacements():
|
||||||
mode = 1
|
mode = 1
|
||||||
else:
|
else:
|
||||||
raise Exception("get_all_replacements(): expected mode 0")
|
raise Exception("get_all_replacements(): expected mode 0")
|
||||||
elif line == "#else /* !SDL_ENABLE_OLD_NAMES */":
|
elif line == "#elif !defined(SDL_DISABLE_OLD_NAMES)":
|
||||||
if mode == 1:
|
if mode == 1:
|
||||||
mode = 2
|
mode = 2
|
||||||
else:
|
else:
|
||||||
raise Exception("get_all_replacements(): expected mode 1")
|
raise Exception("get_all_replacements(): expected mode 1")
|
||||||
|
elif line == "#endif /* SDL_ENABLE_OLD_NAMES */":
|
||||||
|
if mode == 2:
|
||||||
|
mode = 3
|
||||||
|
else:
|
||||||
|
raise Exception("add_symbol_to_oldnames(): expected mode 2")
|
||||||
elif mode == 1 and line.startswith("#define "):
|
elif mode == 1 and line.startswith("#define "):
|
||||||
words = line.split()
|
words = line.split()
|
||||||
replacements[words[1]] = words[2]
|
replacements[words[1]] = words[2]
|
||||||
|
# In case things are accidentally renamed to the "X_renamed_Y" symbol
|
||||||
|
#replacements[words[1] + "_renamed_" + words[2]] = words[2]
|
||||||
|
|
||||||
return replacements
|
return replacements
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue