From c54f6df9788d76d7eaa9615622b5f8fa0e4caf41 Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Thu, 6 Aug 2009 01:33:54 +0000 Subject: Fix bug #48575 - Use dlopen() just like all the other *nixes instead of OSX specific code. --- Zend/zend_extensions.c | 61 -------------------------------------------------- 1 file changed, 61 deletions(-) (limited to 'Zend/zend_extensions.c') diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 87a8640ada..08125f3973 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -217,67 +217,6 @@ ZEND_API zend_extension *zend_get_extension(const char *extension_name) return NULL; } -/* - * Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X - * - */ - -#if HAVE_MACH_O_DYLD_H - -void *zend_mh_bundle_load(char* bundle_path) -{ - NSObjectFileImage bundle_image; - NSModule bundle_handle; - NSSymbol bundle_init_nssymbol; - void (*bundle_init)(void); - - if (NSCreateObjectFileImageFromFile(bundle_path, &bundle_image) != NSObjectFileImageSuccess) { - return NULL; - } - - bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_NONE); - NSDestroyObjectFileImage(bundle_image); - - /* call the init function of the bundle */ - bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, "__init"); - if (bundle_init_nssymbol != NULL) { - bundle_init = NSAddressOfSymbol(bundle_init_nssymbol); - bundle_init(); - } - - return bundle_handle; -} - -int zend_mh_bundle_unload(void *bundle_handle) -{ - NSSymbol bundle_fini_nssymbol; - void (*bundle_fini)(void); - - /* call the fini function of the bundle */ - bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, "__fini"); - if (bundle_fini_nssymbol != NULL) { - bundle_fini = NSAddressOfSymbol(bundle_fini_nssymbol); - bundle_fini(); - } - - return (int) NSUnLinkModule(bundle_handle, NULL); -} - -void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name) -{ - NSSymbol symbol; - symbol = NSLookupSymbolInModule(bundle_handle, symbol_name); - return NSAddressOfSymbol(symbol); -} - -const char *zend_mh_bundle_error(void) -{ - /* Witness the state of the art error reporting */ - return NULL; -} - -#endif /* HAVE_MACH_O_DYLD_H */ - /* * Local variables: * tab-width: 4 -- cgit v1.2.1