From 91b1e00f77298b370fd11daf728c96c18ca46490 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 17 Mar 2025 21:02:51 +0100 Subject: [PATCH] fix newlines --- wgpu/backends/wgpu_native/_ffi.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wgpu/backends/wgpu_native/_ffi.py b/wgpu/backends/wgpu_native/_ffi.py index 00a76dd5..2cc34397 100644 --- a/wgpu/backends/wgpu_native/_ffi.py +++ b/wgpu/backends/wgpu_native/_ffi.py @@ -34,7 +34,13 @@ def _get_wgpu_header(*filenames): lines1 = [] for filename in filenames: with open(filename, "rb") as f: - lines1.extend(f.read().decode().replace("\\\n", "").splitlines(True)) + lines1.extend( + f.read() + .decode() + .replace("\r\n", "\n") + .replace("\\\n", "") + .splitlines(True) + ) # Deal with pre-processor commands, because cffi cannot handle them. # Just removing them, plus a few extra lines, seems to do the trick. lines2 = []