mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-15 09:18:27 +00:00
Removed the SDL_Version structure, moved SDL version to SDL.h
Inspired by https://github.com/libsdl-org/SDL/issues/9788
This commit is contained in:
parent
5a0879b7dd
commit
661f2fc1fc
20 changed files with 162 additions and 224 deletions
|
@ -509,12 +509,12 @@ class Releaser:
|
|||
|
||||
@classmethod
|
||||
def extract_sdl_version(cls, root: Path, project: str):
|
||||
with open(root / f"include/{project}/SDL_version.h", "r") as f:
|
||||
with open(root / f"include/{project}/SDL.h", "r") as f:
|
||||
text = f.read()
|
||||
major = next(re.finditer(r"^#define SDL_MAJOR_VERSION\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
minor = next(re.finditer(r"^#define SDL_MINOR_VERSION\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
patch = next(re.finditer(r"^#define SDL_PATCHLEVEL\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
return f"{major}.{minor}.{patch}"
|
||||
micro = next(re.finditer(r"^#define SDL_MICRO_VERSION\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
return f"{major}.{minor}.{micro}"
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue