[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - include/vcl
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Nov 5 12:19:39 UTC 2018
include/vcl/builderfactory.hxx | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
New commits:
commit 6e9ca7c925671165057743cfdc73272afeffe7ab
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Sat Nov 3 01:29:25 2018 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Nov 5 13:18:56 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/62870
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx
index 8014832b3ac2..69a7a6b12796 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 SAL_CALL make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
+ extern "C" BUILDER_FACTORY_EXPORT void SAL_CALL 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 SAL_CALL make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
+ extern "C" BUILDER_FACTORY_EXPORT void SAL_CALL 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 SAL_CALL make##typeName(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
+ extern "C" BUILDER_FACTORY_EXPORT void SAL_CALL 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