ruby-changes:14525
From: wyhaines <ko1@a...>
Date: Thu, 21 Jan 2010 05:26:24 +0900 (JST)
Subject: [ruby-changes:14525] Ruby:r26361 (ruby_1_8_6): eval.c: Backport #2592 ; Added an ifndef for WIN32 so that F_GETFD isn't used on that platform. Fixes a build issue.
wyhaines 2010-01-21 05:19:36 +0900 (Thu, 21 Jan 2010) New Revision: 26361 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26361 Log: 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. Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/dln.c branches/ruby_1_8_6/eval.c Index: ruby_1_8_6/dln.c =================================================================== --- ruby_1_8_6/dln.c (revision 26360) +++ ruby_1_8_6/dln.c (revision 26361) @@ -81,19 +81,28 @@ # 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 @@ #endif #endif #else -#ifdef __APPLE__ +#ifdef MACOSX_DYLD #include <mach-o/dyld.h> #endif #endif @@ -1403,7 +1412,7 @@ } #endif /* _AIX */ -#if defined(NeXT) || defined(__APPLE__) +#if defined(NeXT) || defined(MACOSX_DYLD) #define DLN_DEFINED /*---------------------------------------------------- By SHIROYAMA Takayuki Psi@f... @@ -1527,7 +1536,7 @@ } #endif /* __BEOS__*/ -#ifdef __MACOS__ +#ifdef __MACOS__ /* Mac OS 9 or before */ # define DLN_DEFINED { OSErr err; Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 26360) +++ ruby_1_8_6/ChangeLog (revision 26361) @@ -1,3 +1,9 @@ +Thu Jan 21 5:10:00 2010 Kirk Haines <khaines@r...> + + * 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@r...> * lib/webrick/accesslog.rb : Added escape fixes for logs to fix a log injection attack. Index: ruby_1_8_6/eval.c =================================================================== --- ruby_1_8_6/eval.c (revision 26360) +++ ruby_1_8_6/eval.c (revision 26361) @@ -10818,7 +10818,11 @@ 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/