Merge rest of patch from #72.

This commit is contained in:
Christian Kamm
2008-08-29 14:48:40 +02:00
parent ba21d60706
commit 3e5a20cf6b
3 changed files with 21 additions and 1 deletions

View File

@@ -75,12 +75,16 @@ void _STD_critical_term()
/* ================================= linux ============================ */
#if linux
#if linux || __APPLE__
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif
/******************************************
* Enter/exit critical section.
*/

View File

@@ -85,6 +85,10 @@ extern (C) void* rt_stackBottom()
return *libc_stack_end;
}
}
else version( darwin )
{
static assert( false, "darwin not supported" );
}
else
{
static assert( false, "Operating system not supported." );
@@ -147,6 +151,10 @@ private
alias __data_start Data_Start;
alias _end Data_End;
}
else version( darwin )
{
// TODO: How to access the darwin data segment?
}
alias void delegate( void*, void* ) scanFn;
}
@@ -166,6 +174,10 @@ extern (C) void rt_scanStaticData( scanFn scan )
//printf("scanning static data from %p to %p\n", &Data_Start, &Data_End);
scan( &Data_Start, &Data_End );
}
else version( darwin )
{
static assert( false, "darwin not supported." );
}
else
{
static assert( false, "Operating system not supported." );

View File

@@ -127,6 +127,10 @@ void _d_monitor_unlock(Object *h)
#if USE_PTHREADS
#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif
// Includes attribute fixes from David Friedman's GDC port
static pthread_mutex_t _monitor_critsec;