# HG changeset patch # User Christian Kamm # Date 1220014120 -7200 # Node ID 02fb65cddc3e921f9adbfc288ff4f6987c9fd8c1 # Parent aef77ae1d32cde1dda616957a49516ff2534ce3f Merge rest of patch from #72. diff -r aef77ae1d32c -r 02fb65cddc3e runtime/internal/critical.c --- a/runtime/internal/critical.c Fri Aug 29 14:16:18 2008 +0200 +++ b/runtime/internal/critical.c Fri Aug 29 14:48:40 2008 +0200 @@ -75,12 +75,16 @@ /* ================================= linux ============================ */ -#if linux +#if linux || __APPLE__ #include #include #include +#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE +#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE +#endif + /****************************************** * Enter/exit critical section. */ diff -r aef77ae1d32c -r 02fb65cddc3e runtime/internal/memory.d --- a/runtime/internal/memory.d Fri Aug 29 14:16:18 2008 +0200 +++ b/runtime/internal/memory.d Fri Aug 29 14:48:40 2008 +0200 @@ -85,6 +85,10 @@ 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 @@ 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 @@ //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." ); diff -r aef77ae1d32c -r 02fb65cddc3e runtime/internal/monitor.c --- a/runtime/internal/monitor.c Fri Aug 29 14:16:18 2008 +0200 +++ b/runtime/internal/monitor.c Fri Aug 29 14:48:40 2008 +0200 @@ -127,6 +127,10 @@ #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;