From dee53a32a9feba2021782db5762b5a9a034efae4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 23 Dec 2011 18:41:52 +0100 Subject: Temporary hack around cppu_detail_getCppuType variants violating ODR. Which causes cppuhelper to pick wrong variant from other library, now that its own symbols are no longer reduced to private on Mac OS X. As a temporary hack, emit cppu_detail_getCppuType for the relevant types always as fully comprehensive; should be revisited when improving types.rdb format (routinely generating C++ information for certain UNO types into a dedicated library?). Requires a fix to xmlreader and a fix to forms that looks like a Mac OS X GCC bug. --- codemaker/source/cppumaker/cpputype.cxx | 91 ++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 8 deletions(-) (limited to 'codemaker') diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 3a436ca01111..9636f612f9b3 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -79,6 +79,77 @@ rtl::OString translateSimpleUnoType(rtl::OString const & unoType, bool cppuUnoTy return trans[sort]; } +bool isBootstrapType(rtl::OString const & name) { + static char const * const names[] = { + "com/sun/star/beans/PropertyAttribute", + "com/sun/star/beans/PropertyValue", + "com/sun/star/beans/XFastPropertySet", + "com/sun/star/beans/XMultiPropertySet", + "com/sun/star/beans/XPropertyAccess", + "com/sun/star/beans/XPropertySet", + "com/sun/star/beans/XPropertySetOption", + "com/sun/star/bridge/UnoUrlResolver", + "com/sun/star/bridge/XUnoUrlResolver", + "com/sun/star/connection/SocketPermission", + "com/sun/star/container/XElementAccess", + "com/sun/star/container/XEnumerationAccess", + "com/sun/star/container/XHierarchicalNameAccess", + "com/sun/star/container/XNameAccess", + "com/sun/star/container/XNameContainer", + "com/sun/star/container/XNameReplace", + "com/sun/star/container/XSet", + "com/sun/star/io/FilePermission", + "com/sun/star/io/IOException", + "com/sun/star/lang/DisposedException", + "com/sun/star/lang/WrappedTargetRuntimeException", + "com/sun/star/lang/XComponent", + "com/sun/star/lang/XEventListener", + "com/sun/star/lang/XInitialization", + "com/sun/star/lang/XMultiComponentFactory", + "com/sun/star/lang/XMultiServiceFactory", + "com/sun/star/lang/XServiceInfo", + "com/sun/star/lang/XSingleComponentFactory", + "com/sun/star/lang/XSingleServiceFactory", + "com/sun/star/lang/XTypeProvider", + "com/sun/star/loader/XImplementationLoader", + "com/sun/star/reflection/XArrayTypeDescription", + "com/sun/star/reflection/XCompoundTypeDescription", + "com/sun/star/reflection/XEnumTypeDescription", + "com/sun/star/reflection/XIdlClass", + "com/sun/star/reflection/XIdlField2", + "com/sun/star/reflection/XIdlReflection", + "com/sun/star/reflection/XIndirectTypeDescription", + "com/sun/star/reflection/XInterfaceAttributeTypeDescription", + "com/sun/star/reflection/XInterfaceAttributeTypeDescription2", + "com/sun/star/reflection/XInterfaceMemberTypeDescription", + "com/sun/star/reflection/XInterfaceMethodTypeDescription", + "com/sun/star/reflection/XInterfaceTypeDescription2", + "com/sun/star/reflection/XMethodParameter", + "com/sun/star/reflection/XStructTypeDescription", + "com/sun/star/reflection/XTypeDescription", + "com/sun/star/reflection/XUnionTypeDescription", + "com/sun/star/registry/XImplementationRegistration", + "com/sun/star/registry/XRegistryKey", + "com/sun/star/registry/XSimpleRegistry", + "com/sun/star/security/RuntimePermission", + "com/sun/star/security/XAccessController", + "com/sun/star/uno/DeploymentException", + "com/sun/star/uno/RuntimeException", + "com/sun/star/uno/XAggregation", + "com/sun/star/uno/XComponentContext", + "com/sun/star/uno/XCurrentContext", + "com/sun/star/uno/XUnloadingPreference", + "com/sun/star/uno/XWeak", + "com/sun/star/util/XMacroExpander" + }; // cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing dependencies) + for (std::size_t i = 0; i < SAL_N_ELEMENTS(names); ++i) { + if (name.equals(names[i])) { + return true; + } + } + return false; +} + } //************************************************************************* @@ -221,14 +292,18 @@ sal_Bool CppuType::dump(CppuOptions* pOptions) } addSpecialDependencies(); - // -CS was used as an undocumented option to generate static getCppuType - // functions; since the introduction of cppu::UnoType this no longer is - // meaningful (getCppuType is just a forward to cppu::UnoType::get now), and - // -CS is handled the same way as -C now: - if (pOptions->isValid("-L")) - m_cppuTypeLeak = sal_True; - if (pOptions->isValid("-C") || pOptions->isValid("-CS")) - m_cppuTypeDynamic = sal_False; + if (isBootstrapType(m_typeName)) { + m_cppuTypeDynamic = false; + } else { + // -CS was used as an undocumented option to generate static getCppuType + // functions; since the introduction of cppu::UnoType this no longer is + // meaningful (getCppuType is just a forward to cppu::UnoType::get now), + // and -CS is handled the same way as -C now: + if (pOptions->isValid("-L")) + m_cppuTypeLeak = sal_True; + if (pOptions->isValid("-C") || pOptions->isValid("-CS")) + m_cppuTypeDynamic = sal_False; + } OString outPath; if (pOptions->isValid("-O")) -- cgit v1.2.3