Skip to content

Commit

Permalink
Convert platform dictionary to if-else
Browse files Browse the repository at this point in the history
Makes it more extendible.
  • Loading branch information
upsuper committed Jul 19, 2016
1 parent 9eea2be commit cfc27b3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ports/geckolib/gecko_bindings/tools/regen.py
Expand Up @@ -135,11 +135,13 @@ def platform_dependent_defines():
if os.name == "posix":
ret.append("-DOS_POSIX=1")

ret.append({
"Linux": "-DOS_LINUX=1",
"Darwin": "-DOS_MACOSX=1",
# TODO: Windows?
}[platform.system()])
system = platform.system()
if system == "Linux":
ret.append("-DOS_LINUX=1")
elif system == "Darwin":
ret.append("-DOS_MACOSX=1")
else:
raise Exception("Unknown platform")

return ret

Expand Down

0 comments on commit cfc27b3

Please sign in to comment.