From 7a5ebcbe16e57e47113ea6e0f49cabc7f75c93b4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 18 Oct 2017 15:12:43 +0100 Subject: Modern Slicer doesn't require external linkage of internal parts --- slicer/tool/parser.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp index ce89e2f..51e6f10 100644 --- a/slicer/tool/parser.cpp +++ b/slicer/tool/parser.cpp @@ -148,10 +148,10 @@ namespace Slicer { fprintbf(cpp, "struct isLocal< %s > { static constexpr bool value = true; };\n\n", type); } - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "const std::string ModelPartForRoot< %s >::rootName(\"%s\");\n\n", type, name); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "const std::string ModelPartForRoot< IceUtil::Optional< %s > >::rootName(\"Optional%s\");\n\n", type, name); } @@ -170,7 +170,7 @@ namespace Slicer { fprintbf(cpp, "// Class %s\n", c->name()); visitComplexDataMembers(decl, c->allDataMembers()); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); auto typeId = metaDataValue("slicer:typeid:", c->getMetaData()); fprintbf(cpp, "const std::string ModelPartForClass< %s >::typeIdProperty(\"%s\");\n\n", decl->typeId(), @@ -180,10 +180,10 @@ namespace Slicer { defineRoot(typeToString(decl), name ? *name : c->name(), decl); auto typeName = metaDataValue("slicer:typename:", c->getMetaData()); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "const std::string * ModelPartForClass< %s >::className = nullptr;\n", decl->typeId()); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "const std::string * ModelPartForClass< %s >::typeName = nullptr;\n", decl->typeId()); fprintbf(cpp, "template<>\nvoid ModelPartForClass< %s >::initClassName() {\n\tclassName = new std::string(\"%s\");\n\t", @@ -197,7 +197,7 @@ namespace Slicer { } fprintbf(cpp, "\n}\n"); - fprintbf(cpp, "template<> DLL_PUBLIC\nconst Metadata ModelPartForComplex< %s >::metadata ", + fprintbf(cpp, "template<>\nconst Metadata ModelPartForComplex< %s >::metadata ", c->scoped()); copyMetadata(c->getMetaData()); fprintbf(cpp, ";\n\n"); @@ -231,7 +231,7 @@ namespace Slicer { auto name = metaDataValue("slicer:root:", c->getMetaData()); defineRoot(c->scoped(), name ? *name : c->name(), c); - fprintbf(cpp, "template<> DLL_PUBLIC\nconst Metadata ModelPartForComplex< %s >::metadata ", + fprintbf(cpp, "template<>\nconst Metadata ModelPartForComplex< %s >::metadata ", c->scoped()); copyMetadata(c->getMetaData()); fprintbf(cpp, ";\n\n"); @@ -248,7 +248,7 @@ namespace Slicer { fprintbf(cpp, "typedef ModelPartForComplex< %s > C%d;\n", it->scoped(), components); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "const C%d::Hooks ", components); fprintbf(cpp, "C%d::hooks ([](){\n", @@ -297,12 +297,12 @@ namespace Slicer { if (!cpp) return; fprintbf(cpp, "// Enumeration %s\n", e->name()); - fprintbf(cpp, "template<> DLL_PUBLIC\nconst Metadata ModelPartForEnum< %s >::metadata ", + fprintbf(cpp, "template<>\nconst Metadata ModelPartForEnum< %s >::metadata ", e->scoped()); copyMetadata(e->getMetaData()); fprintbf(cpp, ";\n\n"); - fprintbf(cpp, "template<> DLL_PUBLIC\nconst ModelPartForEnum< %s >::Enumerations\nModelPartForEnum< %s >::enumerations([]() -> ModelPartForEnum< %s >::Enumerations\n", + fprintbf(cpp, "template<>\nconst ModelPartForEnum< %s >::Enumerations\nModelPartForEnum< %s >::enumerations([]() -> ModelPartForEnum< %s >::Enumerations\n", e->scoped(), e->scoped(), e->scoped()); @@ -329,7 +329,7 @@ namespace Slicer { if (!cpp) return; fprintbf(cpp, "// Sequence %s\n", s->name()); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "ChildRef ModelPartForSequence< %s >::GetChildRef(const std::string & name, const HookFilter & flt)\n{\n", s->scoped()); auto iname = metaDataValue("slicer:item:", s->getMetaData()); @@ -342,7 +342,7 @@ namespace Slicer { } fprintbf(cpp, "\treturn GetAnonChildRef(flt);\n}\n\n"); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); auto ename = metaDataValue("slicer:element:", s->getMetaData()); fprintbf(cpp, "const std::string ModelPartForSequence< %s >::elementName(\"%s\");\n\n", s->scoped(), @@ -351,7 +351,7 @@ namespace Slicer { auto name = metaDataValue("slicer:root:", s->getMetaData()); defineRoot(s->scoped(), name ? *name : s->name(), s); - fprintbf(cpp, "template<> DLL_PUBLIC\nconst Metadata ModelPartForSequence< %s >::metadata ", + fprintbf(cpp, "template<>\nconst Metadata ModelPartForSequence< %s >::metadata ", s->scoped()); copyMetadata(s->getMetaData()); fprintbf(cpp, ";\n\n"); @@ -370,14 +370,14 @@ namespace Slicer { fprintbf(cpp, "// Dictionary %s\n", d->name()); auto iname = metaDataValue("slicer:item:", d->getMetaData()); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "const std::string ModelPartForDictionary< %s >::pairName(\"%s\");\n\n", d->scoped(), iname ? *iname : "element"); fprintbf(cpp, "typedef ModelPartForComplex< %s::value_type > C%d;\n", d->scoped(), components); - fprintbf(cpp, "template<> DLL_PUBLIC\n"); + fprintbf(cpp, "template<>\n"); fprintbf(cpp, "const C%d::Hooks ", components); fprintbf(cpp, "C%d::hooks ([](){\n", @@ -404,12 +404,12 @@ namespace Slicer { auto name = metaDataValue("slicer:root:", d->getMetaData()); defineRoot(d->scoped(), name ? *name : d->name(), d); - fprintbf(cpp, "template<> DLL_PUBLIC\nconst Metadata ModelPartForDictionary< %s >::metadata ", + fprintbf(cpp, "template<>\nconst Metadata ModelPartForDictionary< %s >::metadata ", d->scoped()); copyMetadata(d->getMetaData()); fprintbf(cpp, ";\n\n"); - fprintbf(cpp, "template<> DLL_PUBLIC\nconst Metadata ModelPartForComplex<%s::value_type>::metadata ", + fprintbf(cpp, "template<>\nconst Metadata ModelPartForComplex<%s::value_type>::metadata ", d->scoped()); copyMetadata(d->getMetaData()); fprintbf(cpp, ";\n\n"); -- cgit v1.2.3