Skip to content

Commit 266f496

Browse files
authored
fix newlines (#686)
1 parent 499b701 commit 266f496

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

wgpu/backends/wgpu_native/_ffi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ def _get_wgpu_header(*filenames):
3434
lines1 = []
3535
for filename in filenames:
3636
with open(filename, "rb") as f:
37-
lines1.extend(f.read().decode().replace("\\\n", "").splitlines(True))
37+
lines1.extend(
38+
f.read()
39+
.decode()
40+
.replace("\r\n", "\n")
41+
.replace("\\\n", "")
42+
.splitlines(True)
43+
)
3844
# Deal with pre-processor commands, because cffi cannot handle them.
3945
# Just removing them, plus a few extra lines, seems to do the trick.
4046
lines2 = []

0 commit comments

Comments
 (0)