diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-03-13 11:03:04 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-03-14 09:31:42 +0100 |
commit | fc27a685d466dc380a8b68cd48f47db632ed3693 (patch) | |
tree | 3c9d7ec646b878d57742658e361b083d942e2078 /idl/source/objects/types.cxx | |
parent | add shlwapi (diff) | |
download | core-fc27a685d466dc380a8b68cd48f47db632ed3693.tar.gz core-fc27a685d466dc380a8b68cd48f47db632ed3693.zip |
Avoid duplicate symbols in libmerged for Windows too.
Export these symbols from sfx library.
For cases when we link together more libraries, there are more symbols,
so I've kept __attribute__((__weak__)) hack there.
Change-Id: I8b7f6fc9bea479dca5062344c04b74c1f3eb36b2
Diffstat (limited to 'idl/source/objects/types.cxx')
-rw-r--r-- | idl/source/objects/types.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 1797fa2b3409..6dc82163888d 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -1398,7 +1398,7 @@ sal_uLong SvMetaType::MakeSfx( OStringBuffer& rAttrArray ) } void SvMetaType::WriteSfxItem( - const OString& rItemName, SvIdlDataBase &, SvStream & rOutStm ) + const OString& rItemName, SvIdlDataBase& rBase, SvStream& rOutStm ) { WriteStars( rOutStm ); OStringBuffer aVarName(" a"); @@ -1411,14 +1411,35 @@ void SvMetaType::WriteSfxItem( OString::number(nAttrCount)); aTypeName.append(aAttrCount); - rOutStm.WriteCharPtr( "extern " ).WriteCharPtr( aTypeName.getStr() ) + bool bExport = false, bReturn = false; + // these are exported from sfx library + if (rItemName == "SfxBoolItem" || + rItemName == "SfxStringItem" || + rItemName == "SfxUInt16Item" || + rItemName == "SfxUInt32Item" || + rItemName == "SfxVoidItem") + { + if (rBase.sSlotMapFile.endsWith("sfxslots.hxx")) + bExport = true; + else + bReturn = true; + } + + rOutStm.WriteCharPtr( "extern " ); + if (bExport) + rOutStm.WriteCharPtr( "SFX2_DLLPUBLIC " ); + rOutStm.WriteCharPtr( aTypeName.getStr() ) .WriteCharPtr( aVarName.getStr() ).WriteChar( ';' ) << endl; + if (bReturn) + return; // write the implementation part rOutStm.WriteCharPtr( "#ifdef SFX_TYPEMAP" ) << endl; rOutStm.WriteCharPtr( "#if !defined(_WIN32) && ((defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS))) || STATIC_LINKING)" ) << endl; rOutStm.WriteCharPtr( "__attribute__((__weak__))" ) << endl; rOutStm.WriteCharPtr( "#endif" ) << endl; + if (bExport) + rOutStm.WriteCharPtr( "SFX2_DLLPUBLIC " ); rOutStm.WriteCharPtr( aTypeName.getStr() ).WriteCharPtr( aVarName.getStr() ) .WriteCharPtr( " = " ) << endl; rOutStm.WriteChar( '{' ) << endl; |