[FFmpeg-devel] [PATCH] compat/cuda/ptx2c: strip CR from each line
Ricardo Constantino
wiiaboo at gmail.com
Tue Aug 29 03:46:13 EEST 2017
Windows nvcc + cl.exe produce a .ctx file with CR+LF newlines which
need to be stripped to work with gcc.
---
compat/cuda/ptx2c.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
index 1f37023290..44b08b6ea2 100755
--- a/compat/cuda/ptx2c.sh
+++ b/compat/cuda/ptx2c.sh
@@ -29,7 +29,7 @@ NAME="$(basename "$IN" | sed 's/\..*//')"
printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
while read LINE
do
- printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed 's/["\\]/\\&/g')" >> "$OUT"
+ printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 's/["\\]/\\&/g')" >> "$OUT"
done < "$IN"
printf ";\n" >> "$OUT"
--
2.13.3
More information about the ffmpeg-devel
mailing list