Kaydet (Commit) 617479a0 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

For iOS, do actually export UI builder factory functions

In the DISABLE_DYNLOADING case there is normally no need for functions
marked with SAL_DLLPUBLIC_EXPORT to be exported, as these functions
won't be dynamically looked up anyway. Thus, when DISABLE_DYNLOADING,
SAL_DLLPUBLIC_EXPORT is defined in <sal/types.h> to actually mean
__attribute__ ((visibility("hidden"))).

But we do need to export the UI builder factory functions so that the
osl_getFunctionSymbol() in VclBuilder::makeObject() finds them.

(I kinda dislike looking up symbols with dlsym() from the same binary.
We know that the function is there and what its name is, we could just
call it directly. But makeObject() gets the function name as a string,
so we would need a long set of string comparisons to select which
function to call. A bit ugly. Let's see if I can come up with
something elegant enough later.)

Change-Id: Idceaf8c1ed54cd7d372bf4eb85d0428f9b57baeb
Reviewed-on: https://gerrit.libreoffice.org/62799
Tested-by: Jenkins
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 5b32b3df
...@@ -13,22 +13,32 @@ ...@@ -13,22 +13,32 @@
#include <vcl/vclptr.hxx> #include <vcl/vclptr.hxx>
#include <vcl/builder.hxx> #include <vcl/builder.hxx>
// For iOS, SAL_DLLPUBLIC_EXPORT actually expands to __attribute__
// ((visibility("hidden"))). (Ditto for other DISABLE_DYNLOADING
// cases, but let it be as is for them for now.) Undo that trick.
#ifdef IOS
#define BUILDER_FACTORY_EXPORT __attribute__ ((visibility("default")))
#else
#define BUILDER_FACTORY_EXPORT SAL_DLLPUBLIC_EXPORT
#endif
#define VCL_BUILDER_FACTORY(typeName) \ #define VCL_BUILDER_FACTORY(typeName) \
extern "C" SAL_DLLPUBLIC_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \ extern "C" BUILDER_FACTORY_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
{ \ { \
(void)rMap; \ (void)rMap; \
rRet = VclPtr<typeName>::Create(pParent); \ rRet = VclPtr<typeName>::Create(pParent); \
} }
#define VCL_BUILDER_FACTORY_ARGS(typeName,arg1) \ #define VCL_BUILDER_FACTORY_ARGS(typeName,arg1) \
extern "C" SAL_DLLPUBLIC_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \ extern "C" BUILDER_FACTORY_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
{ \ { \
(void)rMap; \ (void)rMap; \
rRet = VclPtr<typeName>::Create(pParent,arg1); \ rRet = VclPtr<typeName>::Create(pParent,arg1); \
} }
#define VCL_BUILDER_FACTORY_CONSTRUCTOR(typeName,arg2) \ #define VCL_BUILDER_FACTORY_CONSTRUCTOR(typeName,arg2) \
extern "C" SAL_DLLPUBLIC_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \ extern "C" BUILDER_FACTORY_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
{ \ { \
OUString sBorder = BuilderUtils::extractCustomProperty(rMap); \ OUString sBorder = BuilderUtils::extractCustomProperty(rMap); \
WinBits wb = arg2; \ WinBits wb = arg2; \
......
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