From: matz@... (Yukihiro Matsumoto) Date: 2002-10-16T00:10:08+09:00 Subject: [ruby-dev:18525] Forward: darwin shared library patch まつもと ゆきひろです Darwinではtwo level namespaceを使うのが望ましいというレポー トです。私には判断できないんで、どなたか(って白山さん指名状 態?)判断していただけませんか? ------- Start of forwarded message ------- Posted: Sun, 13 Oct 2002 11:00:28 -0700 From: Eric Melville Subject: darwin shared library patch To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 00537 In Darwin, the preferred way to build shared libraries is with two level namespaces. The following patch makes it possible to build the ruby shared library in this fashion. I would really like to see this integrated. This patch was created against the 1.6 source. If a patch against the 1.7 source is needed, please let me know. 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) ------- End of forwarded message -------