bug 569145 - fixing FreeBSD regression from the bug 237006. r=igor
authorMarco Perez <bugmail@millibyte.net>
Sun, 30 May 2010 22:50:11 +0200
changeset 43215 af9499c6d1f3a178ad0d34d406d04f058b47931f
parent 43214 9a4b013e060e78f3f4bb0f10ca8d1139422b8c83
child 43216 4cf7355a09d44686b0e01afef48ebed5ffad60c6
push id13641
push userrsayre@mozilla.com
push dateSun, 06 Jun 2010 19:08:23 +0000
treeherdermozilla-central@5b3604a3cfbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersigor
bugs569145, 237006
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
bug 569145 - fixing FreeBSD regression from the bug 237006. r=igor
js/src/jsnativestack.cpp
--- a/js/src/jsnativestack.cpp
+++ b/js/src/jsnativestack.cpp
@@ -41,16 +41,20 @@
 #include "jsnativestack.h"
 
 #ifdef XP_WIN
 # include <windows.h>
 
 #elif defined(XP_MACOSX) || defined(DARWIN) || defined(XP_UNIX)
 # include <pthread.h>
 
+# if defined(__FreeBSD__)
+#  include <pthread_np.h>
+# endif
+
 #else
 # error "Unsupported platform"
 
 #endif
 
 namespace js {
 
 #if defined(XP_WIN) && defined(WINCE)
@@ -145,23 +149,23 @@ GetNativeStackBaseImpl()
 {
     pthread_t thread = pthread_self();
 # if defined(XP_MACOSX) || defined(DARWIN)
     return pthread_get_stackaddr_np(thread);
 
 # else
     pthread_attr_t sattr;
     pthread_attr_init(&sattr);
-#  if defined(PTHREAD_NP_H) || defined(NETBSD)
-    /* e.g. on FreeBSD 5.4, neundorf@kde.org */
+#  if defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(NETBSD)
+    /* e.g. on FreeBSD 4.8 or newer, neundorf@kde.org */
     pthread_attr_get_np(thread, &sattr);
 #  else
     /*
-     * FIXME: this function is non-portable; other POSIX systems may have
-     * different np alternatives
+     * FIXME: this function is non-portable;
+     * other POSIX systems may have different np alternatives
      */
     pthread_getattr_np(thread, &sattr);
 #  endif
 
     void *stackBase = 0;
     size_t stackSize = 0;
 #  ifdef DEBUG
     int rc =