ruby-changes:70875
From: Peter <ko1@a...>
Date: Sat, 15 Jan 2022 01:29:25 +0900 (JST)
Subject: [ruby-changes:70875] 3cc82ff93c (master): Drop support for OSX 10.3 and earlier
https://git.ruby-lang.org/ruby.git/commit/?id=3cc82ff93c From 3cc82ff93c69fbd9d7377aa960ce46a0c24abdda Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Fri, 14 Jan 2022 10:33:42 -0500 Subject: Drop support for OSX 10.3 and earlier dlopen was introduced in OSX 10.4, which was released in 2005. OSX 10.3 was EOL in 2007. --- dln.c | 56 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/dln.c b/dln.c index 44e8c06d04b..e40c3740c87 100644 --- a/dln.c +++ b/dln.c @@ -74,15 +74,6 @@ void *xrealloc(); https://github.com/ruby/ruby/blob/trunk/dln.c#L74 char *getenv(); #endif -#ifdef __APPLE__ -# if defined(HAVE_DLOPEN) - /* Mac OS X with dlopen (10.3 or later) */ -# define MACOSX_DLOPEN -# else -# define MACOSX_DYLD -# endif -#endif - #ifndef dln_loaderror static void dln_loaderror(const char *format, ...) @@ -95,12 +86,12 @@ dln_loaderror(const char *format, ...) https://github.com/ruby/ruby/blob/trunk/dln.c#L86 } #endif -#if defined(HAVE_DLOPEN) && !defined(_AIX) && !defined(MACOSX_DYLD) && !defined(_UNICOSMP) +#if defined(HAVE_DLOPEN) && !defined(_AIX) && !defined(_UNICOSMP) /* dynamic load with dlopen() */ # define USE_DLN_DLOPEN #endif -#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(NeXT) || defined(MACOSX_DYLD) +#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(NeXT) # define EXTERNAL_PREFIX "_" #else # define EXTERNAL_PREFIX "" @@ -168,10 +159,6 @@ static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX https://github.com/ruby/ruby/blob/trunk/dln.c#L159 #define NSLINKMODULE_OPTION_BINDNOW 1 #endif #endif -#else -#ifdef MACOSX_DYLD -#include <mach-o/dyld.h> -#endif #endif #ifdef _WIN32 @@ -449,45 +436,6 @@ dln_load(const char *file) https://github.com/ruby/ruby/blob/trunk/dln.c#L436 } #endif /* _AIX */ -#if defined(MACOSX_DYLD) -#define DLN_DEFINED -/*---------------------------------------------------- - By SHIROYAMA Takayuki Psi@f... - - Special Thanks... - Yu tomoak-i@i..., - Mi hisho@t..., - sunshine@s..., - and... Miss ARAI Akino(^^;) - ----------------------------------------------------*/ - { - int dyld_result; - NSObjectFileImage obj_file; /* handle, but not use it */ - /* "file" is module file name . - "buf" is pointer to initial function name with "_" . */ - - void (*init_fct)(void); - - - dyld_result = NSCreateObjectFileImageFromFile(file, &obj_file); - - if (dyld_result != NSObjectFileImageSuccess) { - dln_loaderror("Failed to load %.200s", file); - } - - NSLinkModule(obj_file, file, NSLINKMODULE_OPTION_BINDNOW); - - /* lookup the initial function */ - if (!NSIsSymbolNameDefined(buf)) { - dln_loaderror("Failed to lookup Init function %.200s",file); - } - init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf)); - (*init_fct)(); - - return (void*)init_fct; - } -#endif - #ifndef DLN_DEFINED dln_notimplement(); #endif -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/