mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 16:43:13 +01:00
Merge rest of patch from #72.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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." );
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user