Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

trunk does not compile on fbsd 7.1

Moderators: kris

Posted: 03/30/09 21:06:12

when firing tango/lib/build-gdc.sh on freebsd 7.1:

it breaks with: (last lines)

gdmd -c -release -O -inline -w -nofloat -version=Posix -q,-nostdinc -I/usr/local/src/tango/tango.trunk/lib/common -I/usr/local/src/tango/tango.trunk/lib/.. -I/usr/local/src/tango/tango.trunk/lib/compiler/gdc -I../../.. -Hfcore/Thread.di core/Thread.d -ofcore/Thread.o
core/Thread.d:587: Error: undefined identifier PTHREAD_CREATE_JOINABLE
gmake[1]: *** [core/Thread.o] Error 1
gmake[1]: Leaving directory `/usr/local/src/tango/tango.trunk/lib/common/tango'
gmake: *** [lib] Error 2
Author Message

Posted: 03/30/09 21:11:39

Hi erpe,

freebsd isn't really supported in Tango yet, although it should be close.

Compile failures are not a surprise at this point though. If you look at #896 and the linked reports there, you may be able to help to get everything up to speed though.

Posted: 03/30/09 22:42:12

hrm - dunno if this helps - guess i'am not experienced enough... at least build-gdc.sh succeeds... ;)

--- tango/stdc/posix/pthread.d.orig     2009-03-30 23:59:48.000000000 +0200
+++ tango/stdc/posix/pthread.d  2009-03-31 00:36:10.000000000 +0200
@@ -165,6 +165,46 @@
         PTHREAD_PROCESS_SHARED  = 1
     }
 }
+else version( freebsd )
+{
+    enum
+    {
+        PTHREAD_CANCEL_ENABLE   = 1,
+        PTHREAD_CANCEL_DISABLE  = 0
+    }
+
+    enum
+    {
+        PTHREAD_CANCEL_DEFERRED     = 2,
+        PTHREAD_CANCEL_ASYNCHRONOUS = 0
+    }
+
+    const PTHREAD_CANCELED = cast(void*) -1;
+
+    //const pthread_mutex_t PTHREAD_COND_INITIALIZER = { __LOCK_ALT_INITIALIZER, 0, "", 0 };
+
+    enum
+    {
+        PTHREAD_CREATE_JOINABLE = 1,
+        PTHREAD_CREATE_DETACHED = 2
+    }
+
+    enum
+    {
+        PTHREAD_INHERIT_SCHED   = 1,
+        PTHREAD_EXPLICIT_SCHED  = 2
+    }
+
+    //const pthread_mutex_t PTHREAD_MUTEX_INITIALIZER = { 0, 0, null, PTHREAD_MUTEX_NORMAL, { 0, 0 } };
+
+    const PTHREAD_ONCE_INIT = 0;
+
+    enum
+    {
+        PTHREAD_PROCESS_PRIVATE = 2,
+        PTHREAD_PROCESS_SHARED  = 1
+    }
+}
 else version( solaris )
 {      
     const PTHREAD_CANCELED = cast(void*)-19;
@@ -744,4 +784,4 @@
        int pthread_mutexattr_getpshared(in pthread_mutexattr_t*, int*);
        int pthread_rwlockattr_getpshared(in pthread_rwlockattr_t*, int*);
        int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int);
-}
\ No newline at end of file
+}