shithub: hj264

Download patch

ref: 440860780f767ae6af42ae2c9f49bcca46b6ceeb
parent: 897140071501dca8d2e54a943a451f2f61d4d51d
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jul 14 07:36:46 EDT 2021

build amd64-specific stuff if possible

--- /dev/null
+++ b/builtins.amd64.s
@@ -1,0 +1,7 @@
+TEXT memcpyf(SB),1,$0
+	MOVQ RARG, DI
+	MOVQ DI, AX
+	MOVQ p2+8(FP), SI
+	MOVL n+16(FP), CX
+	CLD; REP; MOVSB
+	RET
--- a/hj264.c
+++ b/hj264.c
@@ -1,6 +1,8 @@
 #define MINIH264_IMPLEMENTATION
 #define H264E_MAX_THREADS 7
+#ifdef __amd64__
 #define memcpy memcpyf
+#endif
 #include "minih264e.h"
 #include <thread.h>
 #include <bio.h>
--- a/memcpyf.s
+++ /dev/null
@@ -1,7 +1,0 @@
-TEXT memcpyf(SB),1,$0
-	MOVQ RARG, DI
-	MOVQ DI, AX
-	MOVQ p2+8(FP), SI
-	MOVL n+16(FP), CX
-	CLD; REP; MOVSB
-	RET
--- a/mkfile
+++ b/mkfile
@@ -1,6 +1,6 @@
 </$objtype/mkfile
 
-CFLAGS=$CFLAGS -p -I/sys/include/npe -D__plan9__
+CFLAGS=$CFLAGS -p -I/sys/include/npe -D__plan9__ -D__${objtype}__
 BIN=/$objtype/bin/video
 TARG=hj264
 
@@ -11,7 +11,7 @@
 
 OFILES=\
 	hj264.$O\
-	memcpyf.$O\
+	builtins`{test $objtype '=' amd64 && echo -n .$objtype}.$O\
 
 default:V: all