summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-10-18 06:02:16 +0000
committerMichi Henning <michi@zeroc.com>2004-10-18 06:02:16 +0000
commitf2fcae145d79aa0463ec815e4fded8990060a312 (patch)
treed9bce5f6d0dcd3e9c80013f1e2eb7200ce307feb /cpp/src/slice2cpp/Gen.cpp
parentFix to previous fix! :-( Bloody declspec directives, grrr... :-( (diff)
downloadice-f2fcae145d79aa0463ec815e4fded8990060a312.tar.bz2
ice-f2fcae145d79aa0463ec815e4fded8990060a312.tar.xz
ice-f2fcae145d79aa0463ec815e4fded8990060a312.zip
Gave up on the idea of calling a constructor in the generated code -- the
bloody declspecs get in the way for user code. Change the approach to simply instantiate a dummy exception. Not quite as memory-efficient, but at least there are no contortions for the user.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 71fd669cfec..5e66e89e292 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -520,15 +520,6 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
}
}
- H << sp << nl << "struct ICE_API __" << p->name() << "_init";
- H << sb;
- H << nl << "__" << p->name() << "_init();";
- H << eb << ';';
-
- C << sp << nl << scoped << "::__" << p->name() << "_init::__" << p->name() << "_init()";
- C << sb;
- C << eb;
-
string factoryName = "__F" + flattenedScope + name;
C << sp << nl << "class " << factoryName << " : public ::IceInternal::UserExceptionFactory";
@@ -582,8 +573,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
if(!p->isLocal())
{
- H << sp << nl << "static " << name << "::__" << p->name() << "_init __"
- << p->name() << "_initializer; // Force initializers in .cpp file to run";
+ H << sp << nl << "static " << fixKwd(p->scoped()) << " __" << p->name() << "_init;";
}
}
@@ -2274,15 +2264,6 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
C << nl << "extern \"C\" { void " << initfuncname << "() {} }";
C << nl << "#endif";
- H << sp << nl << "struct ICE_API __" << p->name() << "_init";
- H << sb;
- H << nl << "__" << p->name() << "_init();";
- H << eb << ';';
-
- C << sp << nl << scoped << "::__" << p->name() << "_init::__" << name << "_init()";
- C << sb;
- C << eb;
-
H.dec();
H << sp << nl << "private:";
H.inc();
@@ -2294,8 +2275,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
if(!p->isAbstract() && !p->isLocal())
{
- H << sp << nl << "static " << fixKwd(p->name()) << "::__" << p->name() << "_init __"
- << p->name() << "_initializer; // Force initializers in .cpp file to run";
+ H << sp << nl << "static " << scoped << " __" << p->name() << "_init;";
}
if(p->isLocal())