Skip to content

Commit

Permalink
Fix build with recent clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Jan 21, 2024
1 parent fea0c7f commit 4ad479b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

@contextlib.contextmanager
def patched_path(path, old, new):
contents = path.read_text()
contents = path.read_text("latin-1")
if old not in contents:
raise Exception(f"Invalid patch: {old}")
try:
path.write_text(contents.replace(old, new))
path.write_text(contents.replace(old, new), "utf-8")
yield
finally:
path.write_text(contents)
path.write_text(contents, "latin-1")


patches = [
Expand All @@ -32,6 +32,10 @@ def patched_path(path, old, new):
"-Wextra", "-Wextra -Wno-deprecated-declarations -Wno-sign-conversion"),
("Makefiles/Makefile_Mac_clang_shared",
"$(LINK_FLAGS)", "$(LINK_FLAGS) -lc++"),
("TransTableL.cpp",
"const unsigned char lengths[][DDS_SUITS]) const",
"const unsigned char lengths[DDS_SUITS][DDS_SUITS]) const"),
("Moves.cpp", "", ""), # Only for reencoding.
]


Expand Down

0 comments on commit 4ad479b

Please sign in to comment.