pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
Better to just keep calling it pthread_t isntead of casting to anything.

	-mi

--- pr/include/private/pprthred.h.orig	2022-09-12 11:40:15 UTC
+++ pr/include/private/pprthred.h
@@ -11,6 +11,7 @@
 ** developers only.
 */
 #include "nspr.h"
+#include <pthread.h>
 
 #if defined(XP_OS2)
 #define INCL_DOS
@@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
 ** Get the id of the named thread. Each thread is assigned a unique id
 ** when it is created or attached.
 */
-NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
+NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
 
 /*
 ** Set the procedure that is called when a thread is dumped. The procedure
--- pr/src/pthreads/ptthread.c.orig	2022-09-12 11:40:15 UTC
+++ pr/src/pthreads/ptthread.c
@@ -21,7 +21,7 @@
 #include <signal.h>
 #include <dlfcn.h>
 
-#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
+#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY) || defined(MIDNIGHTBSD)
 #include <pthread_np.h>
 #endif
 
@@ -932,7 +932,7 @@ void _PR_InitThreads(
 #endif
 
 #if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
-#if defined(FREEBSD)
+#if defined(FREEBSD) || defined(MIDNIGHTBSD)
     {
         pthread_attr_t attr;
         int policy;
@@ -1183,9 +1183,9 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
     _exit(status);
 }
 
-PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
+PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
 {
-    return (PRUint32)thred->id;  /* and I don't know what they will do with it */
+    return thred->id;  /* and I don't know what they will do with it */
 }
 
 /*
@@ -1414,7 +1414,7 @@ static void suspend_signal_handler(PRInt
     {
 #if !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD) \
     && !defined(BSDI) && !defined(UNIXWARE) \
-    && !defined(DARWIN) && !defined(RISCOS)
+    && !defined(DARWIN) && !defined(RISCOS) && !defined(MIDNIGHTBSD)
         PRIntn rv;
         sigwait(&sigwait_set, &rv);
 #endif
@@ -1671,7 +1671,7 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThre
     }
     memcpy(thread->name, name, nameLen + 1);
 
-#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
+#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY) || defined(MIDNIGHTBSD)
     pthread_set_name_np(thread->id, name);
 #elif defined(ANDROID)
     prctl(PR_SET_NAME, (unsigned long)(name));
