diff options
author | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-20 20:19:36 +0000 |
---|---|---|
committer | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-20 20:19:36 +0000 |
commit | 6a3d12d09f88318f128873755f2717cd358450cc (patch) | |
tree | 8f86b10a014b340e6e25ac3859a90f57a23f0b7e | |
parent | 1070cbd1a38067cc4a9b4ba1844a1dbe84293f3a (diff) |
eval.c: Backport #2592 [ruby-core:27525]; Added an ifndef for WIN32 so that F_GETFD isn't used on that platform. Fixes a build issue.
dln.c: Bug #2220 [ruby-core:26117]; Patch to fix dln.c so that extensions work properly under Snow Leopard.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@26361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | dln.c | 19 | ||||
-rw-r--r-- | eval.c | 4 |
3 files changed, 24 insertions, 5 deletions
@@ -1,3 +1,9 @@ +Thu Jan 21 5:10:00 2010 Kirk Haines <khaines@ruby-lang.org> + + * eval.c: Backport #2592 [ruby-core:27525]; Added an ifndef for WIN32 so that F_GETFD isn't used on that platform. Fixes a build issue. + + * dln.c: Bug #2220 [ruby-core:26117]; Patch to fix dln.c so that extensions work properly under Snow Leopard. + Sun Jan 10 8:00:00 2010 Kirk Haines <khaines@ruby-lang.org> * lib/webrick/accesslog.rb : Added escape fixes for logs to fix a log injection attack. @@ -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; @@ -10818,7 +10818,11 @@ rb_thread_schedule() if ((FD_ISSET(fd, &readfds) || FD_ISSET(fd, &writefds) || FD_ISSET(fd, &exceptfds)) && +#ifndef _WIN32 fcntl(fd, F_GETFD, &dummy) == -1 && +#else + rb_w32_get_osfhandle(fd) == -1 && +#endif errno == EBADF) { badfd = fd; break; |