summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2004-02-10 23:18:16 +0000
committerBenoit Foucher <benoit@zeroc.com>2004-02-10 23:18:16 +0000
commit61e07f2c8b2110b405e47c8bdc94095e0d754042 (patch)
tree14a31ba3bfc89b806c81f92f388276f467b46e62 /cpp/src/slice2cpp/Gen.cpp
parentFixed Win32 build (_win9x -> win9x()) (diff)
downloadice-61e07f2c8b2110b405e47c8bdc94095e0d754042.tar.bz2
ice-61e07f2c8b2110b405e47c8bdc94095e0d754042.tar.xz
ice-61e07f2c8b2110b405e47c8bdc94095e0d754042.zip
MacOS X port.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 40474e6ba9d..c21bdfc428e 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -509,6 +509,15 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
C << eb;
C << eb << ";";
C << sp << nl << "static __F__" << name << "__Init __F__" << name << "__i;";
+ C << sp << nl << "#ifdef __APPLE__";
+ std::string initfuncname = "__F";
+ for(std::string::const_iterator p = scope.begin(); p != scope.end(); ++p)
+ {
+ initfuncname += ((*p) == ':') ? '_' : *p;
+ }
+ initfuncname += name + "__initializer";
+ C << nl << "extern \"C\" { void " << initfuncname << "() {} }";
+ C << nl << "#endif";
}
H.dec();
@@ -2290,6 +2299,15 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
C << sp;
C << nl << "static " << factoryName << "__Init " << factoryName << "__i;";
+ C << sp << nl << "#ifdef __APPLE__";
+ std::string initfuncname = "__F";
+ for(std::string::const_iterator p = scope.begin(); p != scope.end(); ++p)
+ {
+ initfuncname += ((*p) == ':') ? '_' : *p;
+ }
+ initfuncname += name + "__initializer";
+ C << nl << "extern \"C\" { void " << initfuncname << "() {} }";
+ C << nl << "#endif";
}
}