Skip to content

Commit 5fe1643

Browse files
committed
Resolve restrict qualifiers instead of ignoring them
1 parent b2f8c1c commit 5fe1643

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎build_libtcod.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
RE_TAGS = re.compile(
4545
r"TCODLIB_C?API|TCOD_PUBLIC|TCOD_PRIVATE|TCOD_NODISCARD|TCOD_DEPRECATED_NOMESSAGE|TCOD_DEPRECATED_ENUM"
4646
r"|(TCOD_DEPRECATED\(\".*?\"\))"
47-
r"|(TCOD_DEPRECATED|TCODLIB_FORMAT)\([^)]*\)|__restrict"
47+
r"|(TCOD_DEPRECATED|TCODLIB_FORMAT)\([^)]*\)"
4848
r"|TCODLIB_(BEGIN|END)_IGNORE_DEPRECATIONS"
4949
)
5050
RE_VAFUNC = re.compile(r"^[^;]*\([^;]*va_list.*\);", re.MULTILINE)
@@ -74,6 +74,7 @@ def __init__(self, path: Path) -> None:
7474
header = RE_TAGS.sub("", header)
7575
header = RE_VAFUNC.sub("", header)
7676
header = RE_INLINE.sub(r"\1;", header)
77+
header = header.replace("__restrict", "restrict") # Resolve header qualifier
7778
self.header = header.strip()
7879
self.depends = frozenset(depends)
7980
self.all_headers[self.path] = self
@@ -210,7 +211,6 @@ def walk_sources(directory: str) -> Iterator[str]:
210211
"-O3",
211212
"-fPIC",
212213
"-Wno-deprecated-declarations",
213-
"-Wno-discarded-qualifiers", # Ignore discarded restrict qualifiers.
214214
],
215215
}
216216

0 commit comments

Comments
 (0)