summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp29
-rw-r--r--cpp/src/slice2cpp/Main.cpp2
-rw-r--r--cpp/src/slice2cpp/Makefile.mak32
3 files changed, 51 insertions, 12 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index b8d889059b3..76c5167f616 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1527,11 +1527,12 @@ Slice::Gen::TypesVisitor::emitUpcall(const ExceptionPtr& base, const string& cal
C.zeroIndent();
C << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERBUG
C.restoreIndent();
- C << nl << (base ? fixKwd(base->name()) : (isLocal ? "LocalException" : "UserException")) << call;
+ C << nl << (base ? fixKwd(base->name()) : string(isLocal ? "LocalException" : "UserException")) << call;
C.zeroIndent();
C << nl << "#else";
C.restoreIndent();
- C << nl << (base ? fixKwd(base->scoped()) : (isLocal ? "::Ice::LocalException" : "::Ice::UserException")) << call;
+ C << nl << (base ? fixKwd(base->scoped()) : string(isLocal ? "::Ice::LocalException" : "::Ice::UserException"))
+ << call;
C.zeroIndent();
C << nl << "#endif";
C.restoreIndent();
@@ -3698,8 +3699,9 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
}
C << eb;
}
- else if(StructPtr s = StructPtr::dynamicCast(p))
+ else if(StructPtr::dynamicCast(p))
{
+ StructPtr s = StructPtr::dynamicCast(p);
DataMemberList dml = s->dataMembers();
for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i)
{
@@ -3709,8 +3711,9 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
}
}
}
- else if(DictionaryPtr d = DictionaryPtr::dynamicCast(p))
+ else if(DictionaryPtr::dynamicCast(p))
{
+ DictionaryPtr d = DictionaryPtr::dynamicCast(p);
string scoped = fixKwd(d->scoped());
ostringstream tmp;
tmp << "_i" << level;
@@ -3723,8 +3726,9 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
C << eb;
C << eb;
}
- else if(SequencePtr s = SequencePtr::dynamicCast(p))
+ else if(SequencePtr::dynamicCast(p))
{
+ SequencePtr s = SequencePtr::dynamicCast(p);
string scoped = fixKwd(s->scoped());
ostringstream tmp;
tmp << "_i" << level;
@@ -3769,8 +3773,9 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
C << eb;
C << eb;
}
- else if(StructPtr s = StructPtr::dynamicCast(p))
+ else if(StructPtr::dynamicCast(p))
{
+ StructPtr s = StructPtr::dynamicCast(p);
DataMemberList dml = s->dataMembers();
for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i)
{
@@ -3780,8 +3785,9 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
}
}
}
- else if(DictionaryPtr d = DictionaryPtr::dynamicCast(p))
+ else if(DictionaryPtr::dynamicCast(p))
{
+ DictionaryPtr d = DictionaryPtr::dynamicCast(p);
string scoped = fixKwd(d->scoped());
ostringstream tmp;
tmp << "_i" << level;
@@ -3794,8 +3800,9 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
C << eb;
C << eb;
}
- else if(SequencePtr s = SequencePtr::dynamicCast(p))
+ else if(SequencePtr::dynamicCast(p))
{
+ SequencePtr s = SequencePtr::dynamicCast(p);
string scoped = fixKwd(s->scoped());
ostringstream tmp;
tmp << "_i" << level;
@@ -3916,11 +3923,11 @@ Slice::Gen::ObjectVisitor::emitUpcall(const ClassDefPtr& base, const string& cal
C.zeroIndent();
C << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERBUG
C.restoreIndent();
- C << nl << (base ? fixKwd(base->name()) : "Object") << call;
+ C << nl << (base ? fixKwd(base->name()) : string("Object")) << call;
C.zeroIndent();
C << nl << "#else";
C.restoreIndent();
- C << nl << (base ? fixKwd(base->scoped()) : "::Ice::Object") << call;
+ C << nl << (base ? fixKwd(base->scoped()) : string("::Ice::Object")) << call;
C.zeroIndent();
C << nl << "#endif";
C.restoreIndent();
@@ -4974,7 +4981,7 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
C << sp << nl << "IceAsync" << classScopedAMD << '_' << name << "::" << classNameAMD << '_' << name
<< "(::IceInternal::Incoming& in) :";
C.inc();
- C << nl << "IncomingAsync(in)";
+ C << nl << "::IceInternal::IncomingAsync(in)";
C.dec();
C << sb;
C << eb;
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index 7a59173d5e4..645bce922dd 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -84,7 +84,7 @@ main(int argc, char* argv[])
vector<string> args;
try
{
- args = opts.parse(argc, argv);
+ args = opts.parse(argc, (const char**)argv);
}
catch(const IceUtil::Options::BadOpt& e)
{
diff --git a/cpp/src/slice2cpp/Makefile.mak b/cpp/src/slice2cpp/Makefile.mak
new file mode 100644
index 00000000000..382009e1c51
--- /dev/null
+++ b/cpp/src/slice2cpp/Makefile.mak
@@ -0,0 +1,32 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..
+
+NAME = $(top_srcdir)\bin\slice2cpp.exe
+
+TARGETS = $(NAME)
+
+OBJS = Gen.o \
+ Main.o
+
+SRCS = $(OBJS:.o=.cpp)
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+CPPFLAGS = -I. $(CPPFLAGS)
+
+$(NAME): $(OBJS)
+ del /q $@
+ $(LINK) $(LD_EXEFLAGS) $(OBJS), $@,, slice$(LIBSUFFIX).lib $(BASELIBS)
+
+install:: all
+ copy $(NAME) $(install_bindir)
+
+!include .depend