summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-11-03 01:29:25 +0200
committerTor Lillqvist <tml@collabora.com>2018-11-03 15:32:59 +0100
commit617479a003b5f3fa876e371fe16d3a5678f2c501 (patch)
tree70317fb2abc95c7e174d50f38ec92320201f7a52
parent5b32b3df5d4e19b9515ac4e71958a3cdffdc68a8 (diff)
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@collabora.com>
-rw-r--r--include/vcl/builderfactory.hxx16
1 files changed, 13 insertions, 3 deletions
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; \