Kaydet (Commit) 9ddb1a12 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Check explicitly for function names and link directly to them on iOS

When building the iOS app with optimisation (using the Release
configurtaion), the linker will not include functions even if they
have been marked with __attribute__ ((visibility("default"))). To get
such a function included, you need an actual reference to it.

Sure, I could probably do some other trick instead. Or I could use a
table and loop here instead of a sequence of if statements. Later.

Change-Id: I86fa38838f242fd1ac251da6e3885f5b166963d3
üst 0cb0c7f0
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
rRet = VclPtr<typeName>::Create(pParent,wb); \ rRet = VclPtr<typeName>::Create(pParent,wb); \
} }
#define VCL_BUILDER_FACTORY_EXTERN(typeName) \
extern "C" void make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include <unotools/resmgr.hxx> #include <unotools/resmgr.hxx>
#include <vcl/builder.hxx> #include <vcl/builder.hxx>
#include <vcl/builderfactory.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/dialog.hxx> #include <vcl/dialog.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
...@@ -1488,6 +1489,15 @@ void VclBuilder::preload() ...@@ -1488,6 +1489,15 @@ void VclBuilder::preload()
#endif // DISABLE_DYNLOADING #endif // DISABLE_DYNLOADING
} }
#if defined DISABLE_DYNLOADING && !HAVE_FEATURE_DESKTOP
VCL_BUILDER_FACTORY_EXTERN(CustomPropertiesControl);
VCL_BUILDER_FACTORY_EXTERN(RefButton);
VCL_BUILDER_FACTORY_EXTERN(RefEdit);
VCL_BUILDER_FACTORY_EXTERN(ScRefButtonEx);
#endif
VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &name, const OString &id, VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &name, const OString &id,
stringmap &rMap) stringmap &rMap)
{ {
...@@ -2040,12 +2050,22 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & ...@@ -2040,12 +2050,22 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
} }
else else
pFunction = reinterpret_cast<customMakeWidget>(aI->second->getFunctionSymbol(sFunction)); pFunction = reinterpret_cast<customMakeWidget>(aI->second->getFunctionSymbol(sFunction));
#elif !HAVE_FEATURE_DESKTOP
if (false)
; // Just so that all the other condition line pairs look the same
else if (sFunction == "makeCustomPropertiesControl")
pFunction = makeCustomPropertiesControl;
else if (sFunction == "makeRefButton")
pFunction = makeRefButton;
else if (sFunction == "makeRefEdit")
pFunction = makeRefEdit;
else if (sFunction == "makeScRefButtonEx")
pFunction = makeScRefButtonEx;
SAL_WARN_IF(!pFunction, "vcl.layout", "Missing case for " << sFunction);
assert(pFunction);
#else #else
pFunction = reinterpret_cast<customMakeWidget>(osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData)); pFunction = reinterpret_cast<customMakeWidget>(osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData));
#if !HAVE_FEATURE_DESKTOP
SAL_WARN_IF(!pFunction, "vcl.layout", "Lookup of " << sFunction << " failed");
assert(pFunction);
#endif
#endif #endif
if (pFunction) if (pFunction)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment