contrib & lib: fix other clients of clock
[nit.git] / lib / pthreads / pthreads.nit
index bbff9fc..1db10b2 100644 (file)
@@ -16,7 +16,7 @@
 
 # Main POSIX threads support and intro the classes `Thread`, `Mutex` and `Barrier`
 module pthreads is
-       cflags "-pthread"
+       cflags "-pthread -Wno-unknown-attributes"
        ldflags "-pthread"
        pkgconfig "bdw-gc"
        new_annotation threaded
@@ -33,10 +33,19 @@ in "C Header" `{
 `}
 
 in "C" `{
+       #include <string.h>
+
        // TODO protect with: #ifdef WITH_LIBGC
        // We might have to add the next line to gc_chooser.c too, especially
        // if we get an error like "thread not registered with GC".
-       #ifndef ANDROID
+       #ifdef __APPLE__
+               #include "TargetConditionals.h"
+               #if TARGET_OS_IPHONE == 1
+                       #define IOS
+               #endif
+       #endif
+
+       #if !defined(__ANDROID__) && !defined(IOS)
                #define GC_THREADS
                #include <gc.h>
        #endif