Commit Diff


commit - be9e0e98579e6dec33814f1074d22943eb87ef2b
commit + 5ba33c04daeca7f84d0d0148725e593a0c672343
blob - 274d5b038d194e9550f43606ae213777cdf626cd
blob + a5bcb9ce46aa3d91e8bd38fda3f0c7c04417f71d
--- include/geometry.h
+++ include/geometry.h
@@ -59,7 +59,7 @@ Quaternion qadd(Quaternion, Quaternion);
 Quaternion qsub(Quaternion, Quaternion);
 Quaternion qneg(Quaternion);
 Quaternion qmul(Quaternion, Quaternion);
-Quaternion qdiv(Quaternion, Quaternion);
+Quaternion p9qdiv(Quaternion, Quaternion);
 Quaternion qunit(Quaternion);
 Quaternion qinv(Quaternion);
 double qlen(Quaternion);
@@ -94,6 +94,11 @@ Point3 xformpoint(Point3, Space *, Space *);
 Point3 xformpointd(Point3, Space *, Space *);
 Point3 xformplane(Point3, Space *, Space *);
 #define	radians(d)	((d)*.01745329251994329572)
+
+#ifndef NOPLAN9DEFINES
+#define	qdiv	p9qdiv	/* for NetBSD */
+#endif
+
 #if defined(__cplusplus)
 }
 #endif
blob - 54f4df594213f6ad09ce74e5f07a1596d21048ec
blob + 84cd78d0d1dcefb0a8f33a0edd9097f3eb4da6eb
--- include/u.h
+++ include/u.h
@@ -8,6 +8,7 @@ extern "C" {
 #define __EXTENSIONS__ 1 /* SunOS */
 /* NOT USING #define __MAKECONTEXT_V2_SOURCE 1 / * SunOS */
 #define _BSD_SOURCE 1
+#define _NETBSD_SOURCE 1	/* NetBSD */
 #define _SVID_SOURCE 1
 #define _XOPEN_SOURCE 1000
 #define _XOPEN_SOURCE_EXTENDED 1
@@ -74,6 +75,13 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)
 #	undef _NEEDUSHORT
 #	undef _NEEDUINT
 #	define _NEEDLL 1
+#elif defined(__NetBSD__)
+#	include <sched.h>
+#	include <sys/types.h>
+#	undef _NEEDUSHORT
+#	undef _NEEDUINT
+#	undef _NEEDULONG
+#	undef PLAN9PORT_USING_PTHREADS
 #else
 	/* No idea what system this is -- try some defaults */
 #	include <pthread.h>
blob - 941df2456840dcaeee36ff59310f326587fce7c6
blob + 224baea7206af6c92d7df6a859f9c8c5be309abe
--- man/man3/quaternion.3
+++ man/man3/quaternion.3
@@ -150,3 +150,10 @@ This is just a rotation about the same axis by half th
 .SH SEE ALSO
 .IR matrix (3),
 .IR qball (3)
+.SH BUGS
+To avoid name conflicts with NetBSD,
+.I qdiv
+is a preprocessor macro defined as 
+.IR p9qdiv ;
+see
+.IR intro (3).
blob - e77517a81bf597c9f107c665f027a0716b5afcab
blob + b1bf3ccfa34d34c330136f9987db595eb4d5a939
--- src/libthread/mkfile
+++ src/libthread/mkfile
@@ -24,8 +24,10 @@ tspawnloop: tspawnloop.$O
 	9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
 
 %.$O: %.c
-	9c -I. $stem.c
+	$CC -I. $stem.c
 
+NetBSD.$O: Linux.c
+
 test:V: tprimes tspawn
 	primes 1 10007 >p1.txt
 	$PLAN9/bin/time ./tprimes 10000 >tp1.txt
blob - a7af0f5ba39c9a134a69a0cdf60cfd7c30178b6d
blob + 37ab6eb5ea203b145981f05beeccceea87d53246
--- src/libthread/sysofiles.sh
+++ src/libthread/sysofiles.sh
@@ -17,6 +17,9 @@ case "$tag" in
 *-FreeBSD-*)
 	echo $SYSNAME.o ${SYSNAME}asm.o
 	;;
+*-NetBSD-*)
+	echo $SYSNAME.o ${SYSNAME}asm.o
+	;;
 *-Darwin-*)
 	echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o
 	;;