The following commit has been merged in the jessie branch:
commit 2c48f7d78bb7a5ad52b6f0190b2715c42ef4748c
Author: Bas Couwenberg <sebas...@xs4all.nl>
Date:   Wed Oct 9 01:36:40 2013 +0200

    Add patch to use thr_self syscall on kFreeBSD.

diff --git a/debian/changelog b/debian/changelog
index 44e18f4..bfe70a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ osgearth (2.4.0+dfsg-6) unstable; urgency=low
   * Add patch to fix FTBFS on kfreebsd-*, use pthread_self instead of gettid.
     Thanks Steven Chamberlain for the patch.
     (closes: #725383)
+  * Add patch to use thr_self syscall on kFreeBSD.
+    Thanks Petr Salinger, Robert Millan and Ed Maste for the advice.
 
  -- Bas Couwenberg <sebas...@xs4all.nl>  Tue, 24 Sep 2013 16:59:37 +0200
 
diff --git a/debian/patches/kfreebsd-getCurrentThreadId.patch 
b/debian/patches/kfreebsd-getCurrentThreadId.patch
new file mode 100644
index 0000000..c4eacab
--- /dev/null
+++ b/debian/patches/kfreebsd-getCurrentThreadId.patch
@@ -0,0 +1,25 @@
+Description: Use thr_self syscall on kFreeBSD.
+Author: Bas Couwenberg <sebas...@xs4all.nl>
+Last-Update: 2013-10-09
+--- a/src/osgEarth/ThreadingUtils.cpp
++++ b/src/osgEarth/ThreadingUtils.cpp
+@@ -20,7 +20,7 @@
+ 
+ #ifdef _WIN32
+     extern "C" unsigned long __stdcall GetCurrentThreadId();
+-#elif defined(__APPLE__) || defined(__LINUX__)
++#elif defined(__APPLE__) || defined(__LINUX__) || defined(__FreeBSD__) || 
defined(__FreeBSD_kernel__)
+ #   include <unistd.h>
+ #   include <sys/syscall.h>
+ #else
+@@ -42,6 +42,10 @@ unsigned osgEarth::Threading::getCurrent
+   return ::syscall(SYS_thread_selfid);
+ #elif __LINUX__
+   return (unsigned)::syscall(SYS_gettid);
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++  long  tid;
++  syscall(SYS_thr_self, &tid);
++  return (unsigned)tid;
+ #else
+   /* :XXX: this truncates to 32 bits, but better than nothing */
+   return (unsigned)pthread_self();
diff --git a/debian/patches/series b/debian/patches/series
index 213f5c1..2779e52 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ soversion.patch
 MPGeometry-OpenSceneGraph-3.1.8.patch
 becuase-typo.patch
 fallback-getCurrentThreadId.patch
+kfreebsd-getCurrentThreadId.patch

-- 
osgEarth terrain rendering toolkit

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to