Convert platform dictionary to if-else

Makes it more extendible.
This commit is contained in:
Xidorn Quan 2016-07-19 10:02:10 +10:00
parent 9eea2be09e
commit cfc27b3df5

View file

@ -135,11 +135,13 @@ def platform_dependent_defines():
if os.name == "posix": if os.name == "posix":
ret.append("-DOS_POSIX=1") ret.append("-DOS_POSIX=1")
ret.append({ system = platform.system()
"Linux": "-DOS_LINUX=1", if system == "Linux":
"Darwin": "-DOS_MACOSX=1", ret.append("-DOS_LINUX=1")
# TODO: Windows? elif system == "Darwin":
}[platform.system()]) ret.append("-DOS_MACOSX=1")
else:
raise Exception("Unknown platform")
return ret return ret