Author: damjan Date: Mon Dec 3 17:51:52 2018 New Revision: 1848076 URL: http://svn.apache.org/viewvc?rev=1848076&view=rev Log: After much experimentation, it was found that on Windows WeakImplHelper1 needs to be SAL_DLLPUBLIC_EXPORT to prevent multiple definition errors when building in debug mode as opposed to CPPUHELPER_DLLPUBLIC we would normally use.
Without -DCPPUHELPER_DLLIMPLEMENTATION, the header's CPPUHELPER_DLLPUBLIC would become SAL_DLLPUBLIC_IMPORT, and on MSVC that presumbly causes symbols to be redefined and exported for some unknown reason, whereas when we use only SAL_DLLPUBLIC_EXPORT, it is exported in multiple modules, but at least when building those modules we won't get errors, as the modules' dependencies presumably aren't searched. This has no effect on FreeBSD and hopefully other platforms. Make all WeakImplHelper[1-12] SAL_DLLPUBLIC_EXPORT just in case. This need for mysterious platform-specific code attributes that affect the linker in undocumented ways really reveals a profound and terrible truth: how ugly, poor, flimsy, degenerate, twisted, dark, revolting and sick C++ remains as a language, even after decades of its development. Patch by: me Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase1.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase10.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase11.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase12.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase2.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase3.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase4.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase5.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase6.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase7.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase8.hxx openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase9.hxx Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase1.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase1.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase1.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase1.hxx Mon Dec 3 17:51:52 2018 @@ -88,7 +88,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1 > - class SAL_NO_VTABLE WeakImplHelper1 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper1 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase10.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase10.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase10.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase10.hxx Mon Dec 3 17:51:52 2018 @@ -98,7 +98,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 > - class SAL_NO_VTABLE WeakImplHelper10 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper10 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase11.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase11.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase11.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase11.hxx Mon Dec 3 17:51:52 2018 @@ -99,7 +99,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11 > - class SAL_NO_VTABLE WeakImplHelper11 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper11 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase12.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase12.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase12.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase12.hxx Mon Dec 3 17:51:52 2018 @@ -100,7 +100,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12 > - class SAL_NO_VTABLE WeakImplHelper12 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper12 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase2.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase2.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase2.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase2.hxx Mon Dec 3 17:51:52 2018 @@ -89,7 +89,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2 > - class SAL_NO_VTABLE WeakImplHelper2 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper2 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase3.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase3.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase3.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase3.hxx Mon Dec 3 17:51:52 2018 @@ -90,7 +90,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3 > - class SAL_NO_VTABLE WeakImplHelper3 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper3 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase4.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase4.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase4.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase4.hxx Mon Dec 3 17:51:52 2018 @@ -92,7 +92,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4 > - class SAL_NO_VTABLE WeakImplHelper4 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper4 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase5.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase5.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase5.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase5.hxx Mon Dec 3 17:51:52 2018 @@ -93,7 +93,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > - class SAL_NO_VTABLE WeakImplHelper5 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper5 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase6.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase6.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase6.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase6.hxx Mon Dec 3 17:51:52 2018 @@ -94,7 +94,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6 > - class SAL_NO_VTABLE WeakImplHelper6 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper6 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase7.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase7.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase7.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase7.hxx Mon Dec 3 17:51:52 2018 @@ -96,7 +96,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 > - class SAL_NO_VTABLE WeakImplHelper7 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper7 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase8.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase8.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase8.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase8.hxx Mon Dec 3 17:51:52 2018 @@ -96,7 +96,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8 > - class SAL_NO_VTABLE WeakImplHelper8 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper8 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8 Modified: openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase9.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase9.hxx?rev=1848076&r1=1848075&r2=1848076&view=diff ============================================================================== --- openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase9.hxx (original) +++ openoffice/trunk/main/cppuhelper/inc/cppuhelper/implbase9.hxx Mon Dec 3 17:51:52 2018 @@ -98,7 +98,7 @@ namespace cppu Your sub class defines method implementations for these interface(s). */ template< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9 > - class SAL_NO_VTABLE WeakImplHelper9 + class SAL_DLLPUBLIC_EXPORT SAL_NO_VTABLE WeakImplHelper9 : public OWeakObject , public ::com::sun::star::lang::XTypeProvider , public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9