1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* dln.c: use dlopen on Mac OS X 10.3 or later. backport from trunk.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-01-11 02:50:38 +00:00
parent d1345be6c8
commit f18c632ab3
2 changed files with 17 additions and 6 deletions

View file

@ -1,4 +1,6 @@
Fri Jan 11 10:24:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Jan 11 11:50:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dln.c: use dlopen on Mac OS X 10.3 or later. backport from trunk.
* lib/rdoc/options.rb (check_diagram): more precise check, darwin
is not Windows but minwg is on it.

19
dln.c
View file

@ -81,19 +81,28 @@ char *getenv();
# include "macruby_private.h"
#endif
#if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
# if defined(HAVE_DLOPEN)
/* Mac OS X with dlopen (10.3 or later) */
# define MACOSX_DLOPEN
# else
# define MACOSX_DYLD
# endif
#endif
#ifdef __BEOS__
# include <image.h>
#endif
#ifndef NO_DLN_LOAD
#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) && !defined(_UNICOSMP)
#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(MACOSX_DYLD) && !defined(_UNICOSMP)
/* dynamic load with dlopen() */
# define USE_DLN_DLOPEN
#endif
#ifndef FUNCNAME_PATTERN
# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__)
# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
# define FUNCNAME_PATTERN "_Init_%s"
# else
# define FUNCNAME_PATTERN "Init_%s"
@ -1141,7 +1150,7 @@ dln_sym(name)
#endif
#endif
#else
#ifdef __APPLE__
#ifdef MACOSX_DYLD
#include <mach-o/dyld.h>
#endif
#endif
@ -1403,7 +1412,7 @@ dln_load(file)
}
#endif /* _AIX */
#if defined(NeXT) || defined(__APPLE__)
#if defined(NeXT) || defined(MACOSX_DYLD)
#define DLN_DEFINED
/*----------------------------------------------------
By SHIROYAMA Takayuki Psi@fortune.nest.or.jp
@ -1527,7 +1536,7 @@ dln_load(file)
}
#endif /* __BEOS__*/
#ifdef __MACOS__
#ifdef __MACOS__ /* Mac OS 9 or before */
# define DLN_DEFINED
{
OSErr err;