Allow ruby to build as a Mach-O dynamic library with two-level namespace. diff -ruN ruby.orig/eval.c ruby/eval.c --- ruby.orig/eval.c Mon May 27 10:59:43 2002 +++ ruby/eval.c Fri Oct 11 12:51:54 2002 @@ -23,6 +23,10 @@ #include "st.h" #include "dln.h" +#ifdef __APPLE__ +#include +#endif + /* Make alloca work the best possible way. */ #ifdef __GNUC__ # ifndef atarist @@ -1008,6 +1012,8 @@ #ifdef __MACOS__ rb_origenviron = 0; +#elif defined(__APPLE__) + rb_origenviron = *_NSGetEnviron(); #else rb_origenviron = environ; #endif diff -ruN ruby.orig/hash.c ruby/hash.c --- ruby.orig/hash.c Mon May 27 10:59:43 2002 +++ ruby/hash.c Fri Oct 11 12:51:48 2002 @@ -17,6 +17,10 @@ #include "util.h" #include "rubysig.h" +#ifdef __APPLE__ +#include +#endif + #define HASH_DELETED FL_USER1 static void @@ -861,6 +865,11 @@ static char **my_environ; #undef environ #define environ my_environ +#elif defined(__APPLE__) +#undef environ +#define environ *_NSGetEnviron() +#define GET_ENVIRON(e) (e) +#define FREE_ENVIRON(e) #else extern char **environ; #define GET_ENVIRON(e) (e)