Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing the deprecated calls to _dyld_get_image_header_containing_ad…

…dress and replacing them with calls to dladr instead. The dyld function was deprecated from 10.4 and dladr was added in 10.3

This change also fixes the includes of some mac Foundation framework headers.
I have verified that the firebreath code is still able to compile and produce a working plugin.
  • Loading branch information...
commit 27bde25e0f26d3407b1077e3117336992073ae60 1 parent b37582b
Anders Bach Madsen authored taxilian committed
View
7 src/NpapiCore/NpapiPluginModule_NPP.cpp
@@ -14,7 +14,6 @@ Copyright 2009 Richard Bateman, Firebreath development team
#ifdef FB_MACOSX
#include <dlfcn.h>
-#include <mach-o/dyld.h>
#endif
#include <cstdio>
#include "NpapiPlugin.h"
@@ -156,7 +155,11 @@ NPError NpapiPluginModule::NPP_New(NPMIMEType pluginType, NPP instance, uint16_t
{
#ifdef FB_MACOSX
// Helps with certain weird embedding cases
- NpapiPluginModule *module = NpapiPluginModule::GetModule(_dyld_get_image_header_containing_address(__builtin_return_address(0)));
+ Dl_info info;
+
+ dladdr(__builtin_return_address(0), &info);
+
+ NpapiPluginModule *module = NpapiPluginModule::GetModule(info.dli_fbase);
#else
NpapiPluginModule *module = NpapiPluginModule::GetModule(0);
#endif
View
13 src/PluginAuto/Mac/np_macmain.cpp
@@ -10,7 +10,6 @@
#include "NpapiPluginModule.h"
#include <dlfcn.h>
-#include <mach-o/dyld.h>
#include <sys/sysctl.h>
#ifndef NDEBUG
@@ -55,7 +54,9 @@ NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs)
{
FBLOG_INFO("NPAPI", "");
initPluginModule();
- NpapiPluginModule *module = NpapiPluginModule::GetModule(_dyld_get_image_header_containing_address(__builtin_return_address(0)));
+ Dl_info info;
+ dladdr(__builtin_return_address(0), &info);
+ NpapiPluginModule *module = NpapiPluginModule::GetModule(info.dli_fbase);
module->getPluginFuncs(pFuncs);
return NPERR_NO_ERROR;
}
@@ -64,7 +65,9 @@ NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs)
{
/* can't use FBLOG_XXX before GetModule returns, as it calls InitLogging */
initPluginModule();
- NpapiPluginModule *module = NpapiPluginModule::GetModule(_dyld_get_image_header_containing_address(__builtin_return_address(0)));
+ Dl_info info;
+ dladdr(__builtin_return_address(0), &info);
+ NpapiPluginModule *module = NpapiPluginModule::GetModule(info.dli_fbase);
module->setNetscapeFuncs(pFuncs);
FBLOG_INFO("NPAPI", "Initialization done");
@@ -74,6 +77,8 @@ NPError OSCALL NP_Initialize(NPNetscapeFuncs* pFuncs)
NPError OSCALL NP_Shutdown()
{
FBLOG_INFO("NPAPI", "");
- NpapiPluginModule::ReleaseModule(_dyld_get_image_header_containing_address(__builtin_return_address(0)));
+ Dl_info info;
+ dladdr(__builtin_return_address(0), &info);
+ NpapiPluginModule::ReleaseModule(info.dli_fbase);
return NPERR_NO_ERROR;
}
View
6 src/PluginCore/Mac/SystemHelpersMac.mm
@@ -13,9 +13,9 @@
\**********************************************************/
#include "../SystemHelpers.h"
-#import "NSPathUtilities.h"
-#import "NSAutoreleasePool.h"
-#import "NSFileManager.h"
+#import <Foundation/NSPathUtilities.h>
+#import <Foundation/NSAutoreleasePool.h>
+#import <Foundation/NSFileManager.h>
using std::string;
Please sign in to comment.
Something went wrong with that request. Please try again.