[Libreoffice-commits] core.git: include/vcl
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Nov 3 14:33:19 UTC 2018
include/vcl/builderfactory.hxx | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
New commits:
commit 617479a003b5f3fa876e371fe16d3a5678f2c501
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Sat Nov 3 01:29:25 2018 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Sat Nov 3 15:32:59 2018 +0100
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: Tor Lillqvist <tml at collabora.com>
diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx
index 4b8801341f49..1b2d01bd918c 100644
--- a/include/vcl/builderfactory.hxx
+++ b/include/vcl/builderfactory.hxx
@@ -13,22 +13,32 @@
#include <vcl/vclptr.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) \
- 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; \
rRet = VclPtr<typeName>::Create(pParent); \
}
#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; \
rRet = VclPtr<typeName>::Create(pParent,arg1); \
}
#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); \
WinBits wb = arg2; \
More information about the Libreoffice-commits
mailing list