--- ../guile-1.8.1.orig/libguile/threads.c 2006-07-29 21:00:17.000000000 +0300 +++ ./libguile/threads.c 2006-12-26 12:37:51.000000000 +0200 @@ -571,14 +571,17 @@ } #if SCM_USE_PTHREAD_THREADS -/* pthread_getattr_np not available on MacOS X and Solaris 10. */ -#if HAVE_PTHREAD_ATTR_GETSTACK && HAVE_PTHREAD_GETATTR_NP +/* pthread_getattr_np not available on Solaris 10. */ +#if (HAVE_PTHREAD_ATTR_GETSTACK && HAVE_PTHREAD_GETATTR_NP) || defined(__APPLE__) #define HAVE_GET_THREAD_STACK_BASE static SCM_STACKITEM * get_thread_stack_base () { +#if defined(__APPLE__) + return pthread_get_stackaddr_np (pthread_self ()); +#else /* !defined(__APPLE__) */ pthread_attr_t attr; void *start, *end; size_t size; @@ -604,6 +607,7 @@ return end; #endif } +#endif /* defined(__APPLE__) */ } #endif /* HAVE_PTHREAD_ATTR_GETSTACK && HAVE_PTHREAD_GETATTR_NP */