diff options
Diffstat (limited to 'cpp/src')
110 files changed, 2736 insertions, 601 deletions
diff --git a/cpp/src/Freeze/Makefile.mak b/cpp/src/Freeze/Makefile.mak new file mode 100644 index 00000000000..b9382910b3a --- /dev/null +++ b/cpp/src/Freeze/Makefile.mak @@ -0,0 +1,127 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\freeze$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\freeze$(SOVERSION)$(LIBSUFFIX).dll + + +TARGETS = $(LIBNAME) $(DLLNAME) + + +OBJS = CatalogData.o \ + Catalog.o \ + ConnectionI.o \ + Connection.o \ + DB.o \ + EvictorI.o \ + EvictorIteratorI.o \ + Evictor.o \ + EvictorStorage.o \ + Exception.o \ + IndexI.o \ + Index.o \ + MapI.o \ + ObjectStore.o \ + PingObject.o \ + SharedDbEnv.o \ + SharedDb.o \ + TransactionHolder.o \ + TransactionI.o \ + Transaction.o \ + Util.o + +SRCS = $(OBJS:.o=.cpp) + + +HDIR = $(includedir)\Freeze +SDIR = $(slicedir)\Freeze + +!include $(top_srcdir)/config/Make.rules.mak + +CPPFLAGS = -I.. $(CPPFLAGS) -DFREEZE_API_EXPORTS +SLICE2CPPFLAGS = --ice --include-dir Freeze --dll-export FREEZE_API $(SLICE2CPPFLAGS) +LINKWITH = $(LIBS) $(DB_LIBS) + +$(HDIR)/Catalog.h Catalog.cpp: $(SLICE2FREEZE) $(SDIR)/CatalogData.ice + del /q $(HDIR)\Catalog.h Catalog.cpp + $(SLICE2FREEZE) $(SLICE2CPPFLAGS) --dict Freeze::Catalog,string,Freeze::CatalogData \ + Catalog ../../slice/Freeze/CatalogData.ice + move Catalog.h $(HDIR) + +clean:: + del /q $(HDIR)\Catalog.h Catalog.cpp + + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LINKWITH) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +DB.cpp $(HDIR)/DB.h: $(SDIR)/DB.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/DB.ice + move DB.h $(HDIR) + +CatalogData.cpp $(HDIR)/CatalogData.h: $(SDIR)/CatalogData.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/CatalogData.ice + move CatalogData.h $(HDIR) + +Connection.cpp $(HDIR)/Connection.h: $(SDIR)/Connection.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/Connection.ice + move Connection.h $(HDIR) + +$(HDIR)/ConnectionF.h: $(SDIR)/ConnectionF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/ConnectionF.ice + del /q ConnectionF.cpp + move ConnectionF.h $(HDIR) + +Exception.cpp $(HDIR)/Exception.h: $(SDIR)/Exception.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/Exception.ice + move Exception.h $(HDIR) + +$(HDIR)/EvictorF.h: $(SDIR)/EvictorF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/EvictorF.ice + del /q EvictorF.cpp + move EvictorF.h $(HDIR) + +Evictor.cpp $(HDIR)/Evictor.h: $(SDIR)/Evictor.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/Evictor.ice + move Evictor.h $(HDIR) + +EvictorStorage.cpp $(HDIR)/EvictorStorage.h: $(SDIR)/EvictorStorage.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/EvictorStorage.ice + move EvictorStorage.h $(HDIR) + +Transaction.cpp $(HDIR)/Transaction.h: $(SDIR)/Transaction.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)/Transaction.ice + move Transaction.h $(HDIR) + +PingObject.cpp ../Freeze/PingObject.h: PingObject.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) PingObject.ice + +clean:: + del /q DB.cpp $(HDIR)\DB.h + del /q CatalogData.cpp $(HDIR)\CatalogData.h + del /q Connection.cpp $(HDIR)\Connection.h + del /q $(HDIR)\ConnectionF.h + del /q Exception.cpp $(HDIR)\Exception.h + del /q $(HDIR)\EvictorF.h + del /q Evictor.cpp $(HDIR)\Evictor.h + del /q EvictorStorage.cpp $(HDIR)\EvictorStorage.h + del /q Transaction.cpp $(HDIR)\Transaction.h + del /q PingObject.cpp PingObject.h + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + +!include .depend diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp index d2874507c00..13c86e5eaac 100644 --- a/cpp/src/Freeze/MapI.cpp +++ b/cpp/src/Freeze/MapI.cpp @@ -93,7 +93,7 @@ Freeze::MapHelper::create(const Freeze::ConnectionPtr& connection, const std::vector<MapIndexBasePtr>& indices, bool createDb) { - Freeze::ConnectionIPtr connectionI = Freeze::ConnectionIPtr::dynamicCast(connection); + Freeze::ConnectionIPtr connectionI = Freeze::ConnectionIPtr::dynamicCast(connection.get()); return new MapHelperI(connectionI, dbName, key, value, keyCompare, indices, createDb); } diff --git a/cpp/src/FreezeScript/DumpDB.cpp b/cpp/src/FreezeScript/DumpDB.cpp index 135fb269c90..2076bb05676 100644 --- a/cpp/src/FreezeScript/DumpDB.cpp +++ b/cpp/src/FreezeScript/DumpDB.cpp @@ -136,7 +136,7 @@ run(int argc, char** argv, const Ice::CommunicatorPtr& communicator) vector<string> args; try { - args = opts.parse(argc, argv); + args = opts.parse(argc, (const char**)argv); } catch(const IceUtil::Options::BadOpt& e) { @@ -401,7 +401,7 @@ run(int argc, char** argv, const Ice::CommunicatorPtr& communicator) for(vector<string>::iterator p = dbNames.begin(); p != dbNames.end(); ++p) { string name = *p; - string facet = (name == "$default" ? "" : name); + string facet = (name == "$default" ? string("") : name); Db db(&dbEnv, 0); db.open(txn, dbName.c_str(), name.c_str(), DB_BTREE, DB_RDONLY, FREEZE_SCRIPT_DB_MODE); descriptor->dump(communicator, &db, txn, facet); diff --git a/cpp/src/FreezeScript/Makefile.mak b/cpp/src/FreezeScript/Makefile.mak new file mode 100644 index 00000000000..37f995965e1 --- /dev/null +++ b/cpp/src/FreezeScript/Makefile.mak @@ -0,0 +1,75 @@ +# ********************************************************************** +# +# 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 = ..\.. + +TRANSFORMDB = $(top_srcdir)\bin\transformdb.exe +DUMPDB = $(top_srcdir)\bin\dumpdb.exe + +TARGETS = $(TRANSFORMDB) $(DUMPDB) + +COMMON_OBJS = Grammar.o \ + Scanner.o \ + AssignVisitor.o \ + Data.o \ + Error.o \ + Functions.o \ + Exception.o \ + Parser.o \ + Print.o \ + Util.o + +TRANSFORM_OBJS = TransformAnalyzer.o \ + TransformVisitor.o \ + Transformer.o \ + transformdb.o + +DUMP_OBJS = DumpDescriptors.o \ + DumpDB.o + +SRCS = $(COMMON_OBJS:.o=.cpp) $(TRANSFORM_OBJS:.o=.cpp) $(DUMP_OBJS:.o=.cpp) + +HDIR = $(includedir)\FreezeScript + +!include $(top_srcdir)/config/Make.rules.mak + +CPPFLAGS = -I.. $(CPPFLAGS) +LINKWITH = slice$(LIBSUFFIX).lib icexml$(LIBSUFFIX).lib freeze$(LIBSUFFIX).lib $(LIBS) $(DB_LIBS) + +$(TRANSFORMDB): $(TRANSFORM_OBJS) $(COMMON_OBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(TRANSFORM_OBJS) $(COMMON_OBJS), $@,, $(LINKWITH) + +$(DUMPDB): $(DUMP_OBJS) $(COMMON_OBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(DUMP_OBJS) $(COMMON_OBJS), $@,, $(LINKWITH) + +Scanner.cpp : Scanner.l + flex $(FLEXFLAGS) Scanner.l + del /q $@ + echo #include "IceUtil/Config.h" > Scanner.cpp + type lex.yy.c >> Scanner.cpp + del /q lex.yy.c + +Grammar.cpp Grammar.h: Grammar.y + del /q Grammar.h Grammar.cpp + bison -dvt --name-prefix "freeze_script_" Grammar.y + move Grammar.tab.c Grammar.cpp + move Grammar.tab.h Grammar.h + del /q Grammar.output + +clean:: + del /q Grammar.cpp Grammar.h + del /q Scanner.cpp + +install:: all + copy $(TRANSFORMDB) $(install_bindir) + copy $(DUMPDB) $(install_bindir) + +!include .depend diff --git a/cpp/src/FreezeScript/Parser.cpp b/cpp/src/FreezeScript/Parser.cpp index 6d8baccdf4e..7325f982995 100644 --- a/cpp/src/FreezeScript/Parser.cpp +++ b/cpp/src/FreezeScript/Parser.cpp @@ -137,7 +137,11 @@ FreezeScript::EvaluateException::ice_name() const void FreezeScript::EvaluateException::ice_print(ostream& out) const { +#ifdef __BCPLUSPLUS__ + Ice::Exception::ice_print(out); +#else Exception::ice_print(out); +#endif out << ":\nerror occurred while evaluating expression"; if(!_reason.empty()) { diff --git a/cpp/src/FreezeScript/Print.cpp b/cpp/src/FreezeScript/Print.cpp index 6c713046c79..c4ea1bd8007 100644 --- a/cpp/src/FreezeScript/Print.cpp +++ b/cpp/src/FreezeScript/Print.cpp @@ -97,7 +97,7 @@ void FreezeScript::PrintVisitor::visitProxy(const ProxyDataPtr& data) { string str = data->toString(); - _out << typeToString(data->getType()) << '(' << (str.empty() ? "nil" : str) << ')'; + _out << typeToString(data->getType()) << '(' << (str.empty() ? string("nil") : str) << ')'; } void diff --git a/cpp/src/FreezeScript/transformdb.cpp b/cpp/src/FreezeScript/transformdb.cpp index cf38e463bf5..a3f6468529f 100644 --- a/cpp/src/FreezeScript/transformdb.cpp +++ b/cpp/src/FreezeScript/transformdb.cpp @@ -152,7 +152,7 @@ transformDb(bool evictor, const Ice::CommunicatorPtr& communicator, // Execute the transformation descriptors. // istringstream istr(descriptors); - string facet = (name == "$default" ? "" : name); + string facet = (name == "$default" ? string("") : name); FreezeScript::transformDatabase(communicator, objectFactory, oldUnit, newUnit, &db, dbNew, txnNew, 0, dbName, facet, purgeObjects, cerr, suppress, istr); @@ -235,7 +235,7 @@ run(int argc, char** argv, const Ice::CommunicatorPtr& communicator) 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/Glacier2/FilterI.h b/cpp/src/Glacier2/FilterI.h index fa50d3fe63f..9d1857ab496 100755 --- a/cpp/src/Glacier2/FilterI.h +++ b/cpp/src/Glacier2/FilterI.h @@ -129,7 +129,6 @@ FilterT<T, P>::remove(const std::vector<T>& deletions, const Ice::Current&) while(r != toRemove.end()) { iterator i = mark; - bool found = false; while(i != _items.end() && r != toRemove.end()) { if(*r == *i) @@ -142,7 +141,6 @@ FilterT<T, P>::remove(const std::vector<T>& deletions, const Ice::Current&) ++i; ++r; mark = i; - found = true; } else { diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp index 4868cc29376..cc0c5c6860d 100644 --- a/cpp/src/Glacier2/Glacier2Router.cpp +++ b/cpp/src/Glacier2/Glacier2Router.cpp @@ -11,6 +11,7 @@ #include <IceUtil/UUID.h> #include <IceUtil/Options.h> #include <Ice/Service.h> +#include <Glacier2/RouterI.h> #include <Glacier2/Session.h> #include <Glacier2/SessionRouterI.h> #include <Glacier2/CryptPermissionsVerifierI.h> @@ -78,7 +79,7 @@ Glacier2::RouterService::start(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/Glacier2/Makefile.mak b/cpp/src/Glacier2/Makefile.mak new file mode 100644 index 00000000000..c273e32cf52 --- /dev/null +++ b/cpp/src/Glacier2/Makefile.mak @@ -0,0 +1,133 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\glacier2$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\glacier2$(SOVERSION)$(LIBSUFFIX).dll + +ROUTER = $(top_srcdir)\bin\glacier2router.exe + +!ifdef BUILD_UTILS + +TARGETS = $(ROUTER) + +!else + +TARGETS = $(LIBNAME) $(DLLNAME) + +!endif + +OBJS = PermissionsVerifier.o \ + Router.o \ + SSLInfo.o \ + Session.o + +ROBJS = Blobject.o \ + ClientBlobject.o \ + CryptPermissionsVerifierI.o \ + Glacier2Router.o \ + ProxyVerifier.o \ + RequestQueue.o \ + RouterI.o \ + RoutingTable.o \ + FilterI.o \ + FilterManager.o \ + ServerBlobject.o \ + SessionRouterI.o + +SRCS = $(OBJS:.o=.cpp) \ + $(ROBJS:.o=.cpp) + +HDIR = $(includedir)\Glacier2 +SDIR = $(slicedir)\Glacier2 + +!include $(top_srcdir)\config\Make.rules.mak + +!ifdef BUILD_UTILS + +CPPFLAGS = -I.. $(CPPFLAGS) +LINKWITH = $(LIBS) $(OPENSSL_LIBS) glacier2$(LIBSUFFIX).lib icessl$(LIBSUFFIX).lib + +!else + +CPPFLAGS = -I.. $(CPPFLAGS) -DGLACIER2_API_EXPORTS + +!endif + +SLICE2CPPFLAGS = --include-dir Glacier2 --dll-export GLACIER2_API $(SLICE2CPPFLAGS) + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LIBS) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +$(ROUTER): $(ROBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(ROBJS), $@,, $(LINKWITH) + +$(HDIR)\PermissionsVerifierF.h: $(SDIR)\PermissionsVerifierF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\PermissionsVerifierF.ice + del /q PermissionsVerifierF.cpp + move PermissionsVerifierF.h $(HDIR) + +PermissionsVerifier.cpp $(HDIR)\PermissionsVerifier.h: $(SDIR)\PermissionsVerifier.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\PermissionsVerifier.ice + move PermissionsVerifier.h $(HDIR) + +$(HDIR)\RouterF.h: $(SDIR)\RouterF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\RouterF.ice + del /q RouterF.cpp + move RouterF.h $(HDIR) + +Router.cpp $(HDIR)\Router.h: $(SDIR)\Router.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Router.ice + move Router.h $(HDIR) + +$(HDIR)\SessionF.h: $(SDIR)\SessionF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\SessionF.ice + del /q SessionF.cpp + move SessionF.h $(HDIR) + +Session.cpp $(HDIR)\Session.h: $(SDIR)\Session.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Session.ice + move Session.h $(HDIR) + +SSLInfo.cpp $(HDIR)\SSLInfo.h: $(SDIR)\SSLInfo.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\SSLInfo.ice + move SSLInfo.h $(HDIR) + +!ifdef BUILD_UTILS + +clean:: + del /q $(HDIR)\PermissionsVerifierF.h + del /q PermissionsVerifier.cpp $(HDIR)\PermissionsVerifier.h + del /q $(HDIR)\RouterF.h + del /q Router.cpp $(HDIR)\Router.h + del /q $(HDIR)\SessionF.h + del /q Session.cpp $(HDIR)\Session.h + del /q SSLInfo.cpp $(HDIR)\SSLInfo.h + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + copy $(ROUTER) $(install_bindir) + +!else + +install:: all + +$(EVERYTHING):: + $(MAKE) /f Makefile.mak BUILD_UTILS=1 $@ + +!endif + +!include .depend diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp index dc86b39c1cc..6291efa01ea 100644 --- a/cpp/src/Glacier2/RouterI.cpp +++ b/cpp/src/Glacier2/RouterI.cpp @@ -9,6 +9,8 @@ #include <IceUtil/Random.h> +#include <Glacier2/FilterManager.h> +#include <Glacier2/RoutingTable.h> #include <Glacier2/RouterI.h> #include <Glacier2/Session.h> diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index e80ed0e8e50..b8c7f12b659 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -22,6 +22,9 @@ #include <Ice/TraceUtil.h> #include <Ice/TraceLevels.h> #include <Ice/LoggerUtil.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif using namespace std; using namespace Ice; diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 647d76a5d3c..55a01678fd9 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -24,6 +24,9 @@ #include <Ice/RouterInfo.h> #include <Ice/LocalException.h> #include <Ice/Functional.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif using namespace std; using namespace Ice; diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index e2e6d793c13..d64037fb4ec 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -161,7 +161,12 @@ IceInternal::DynamicLibrary::getSymbol(const string& name) { assert(_hnd != 0); #ifdef _WIN32 +# ifdef __BCPLUSPLUS__ + string newName = "_" + name; + return GetProcAddress(_hnd, newName.c_str()); +# else return GetProcAddress(_hnd, name.c_str()); +# endif #else symbol_type result = dlsym(_hnd, name.c_str()); if(result == 0) diff --git a/cpp/src/Ice/EventHandler.h b/cpp/src/Ice/EventHandler.h index f7836b96b6a..67547044997 100644 --- a/cpp/src/Ice/EventHandler.h +++ b/cpp/src/Ice/EventHandler.h @@ -73,7 +73,7 @@ public: protected: EventHandler(const InstancePtr&); - virtual ~EventHandler(); + ICE_API virtual ~EventHandler(); const InstancePtr _instance; diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index a86ef6afc26..031d3a723bd 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -770,7 +770,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[]) if(printProcessId) { -#ifdef _WIN32 +#ifdef _MSC_VER cout << _getpid() << endl; #else cout << getpid() << endl; diff --git a/cpp/src/Ice/Makefile.mak b/cpp/src/Ice/Makefile.mak new file mode 100644 index 00000000000..e559c44426b --- /dev/null +++ b/cpp/src/Ice/Makefile.mak @@ -0,0 +1,300 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\ice$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\ice$(SOVERSION)$(LIBSUFFIX).dll + +TARGETS = $(LIBNAME) $(DLLNAME) + +OBJS = Acceptor.o \ + Application.o \ + Buffer.o \ + BasicStream.o \ + BuiltinSequences.o \ + CommunicatorI.o \ + Communicator.o \ + ConnectionFactory.o \ + ConnectionI.o \ + ConnectionMonitor.o \ + Connection.o \ + Connector.o \ + Current.o \ + DefaultsAndOverrides.o \ + Direct.o \ + DynamicLibrary.o \ + EndpointFactoryManager.o \ + EndpointFactory.o \ + Endpoint.o \ + EndpointI.o \ + EventHandler.o \ + EventLoggerI.o \ + Exception.o \ + FacetMap.o \ + FactoryTableDef.o \ + FactoryTable.o \ + GC.o \ + GCRecMutex.o \ + GCShared.o \ + Identity.o \ + IdentityUtil.o \ + IncomingAsync.o \ + Incoming.o \ + Initialize.o \ + Instance.o \ + LocalException.o \ + LocalObject.o \ + LocatorInfo.o \ + Locator.o \ + LoggerI.o \ + Logger.o \ + LoggerUtil.o \ + Network.o \ + ObjectAdapterFactory.o \ + ObjectAdapterI.o \ + ObjectAdapter.o \ + ObjectFactoryManager.o \ + ObjectFactory.o \ + Object.o \ + OutgoingAsync.o \ + Outgoing.o \ + PluginManagerI.o \ + Plugin.o \ + Process.o \ + PropertiesI.o \ + Properties.o \ + PropertyNames.o \ + Protocol.o \ + ProtocolPluginFacade.o \ + ProxyFactory.o \ + Proxy.o \ + ReferenceFactory.o \ + Reference.o \ + RouterInfo.o \ + Router.o \ + ServantLocator.o \ + ServantManager.o \ + Service.o \ + SliceChecksumDict.o \ + SliceChecksums.o \ + Stats.o \ + StreamI.o \ + Stream.o \ + StringConverter.o \ + TcpAcceptor.o \ + TcpConnector.o \ + TcpEndpointI.o \ + TcpTransceiver.o \ + ThreadPool.o \ + TraceLevels.o \ + TraceUtil.o \ + Transceiver.o \ + UdpEndpointI.o \ + UdpTransceiver.o \ + UnknownEndpointI.o + +SRCS = $(OBJS:.o=.cpp) + +HDIR = $(includedir)\Ice +SDIR = $(slicedir)\Ice + +!include $(top_srcdir)\config\Make.rules.mak + +CPPFLAGS = -I.. $(CPPFLAGS) -DICE_API_EXPORTS +SLICE2CPPFLAGS = --ice --include-dir Ice --dll-export ICE_API $(SLICE2CPPFLAGS) +LINKWITH = $(BASELIBS) $(BZIP2_LIBS) $(ICE_OS_LIBS) ws2_32.lib + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LINKWITH) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +EventLoggerI.o: EventLoggerMsg.h + +EventLoggerMsg.h EventLoggerMsg.res: EventLoggerMsg.mc + mc EventLoggerMsg.mc + rc -r -fo EventLoggerMsg.res EventLoggerMsg.rc + +BuiltinSequences.cpp $(HDIR)\BuiltinSequences.h: $(SDIR)\BuiltinSequences.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\BuiltinSequences.ice + move BuiltinSequences.h $(HDIR) + +$(HDIR)\CommunicatorF.h: $(SDIR)\CommunicatorF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\CommunicatorF.ice + move CommunicatorF.h $(HDIR) + del /q CommunicatorF.cpp + +Communicator.cpp $(HDIR)\Communicator.h: $(SDIR)\Communicator.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Communicator.ice + move Communicator.h $(HDIR) + +$(HDIR)\ConnectionF.h: $(SDIR)\ConnectionF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ConnectionF.ice + move ConnectionF.h $(HDIR) + del /q ConnectionF.cpp + +Connection.cpp $(HDIR)\Connection.h: $(SDIR)\Connection.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Connection.ice + move Connection.h $(HDIR) + +Current.cpp $(HDIR)\Current.h: $(SDIR)\Current.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Current.ice + move Current.h $(HDIR) + +Endpoint.cpp $(HDIR)\Endpoint.h: $(SDIR)\Endpoint.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Endpoint.ice + move Endpoint.h $(HDIR) + +FacetMap.cpp $(HDIR)\FacetMap.h: $(SDIR)\FacetMap.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\FacetMap.ice + move FacetMap.h $(HDIR) + +Identity.cpp $(HDIR)\Identity.h: $(SDIR)\Identity.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Identity.ice + move Identity.h $(HDIR) + +LocalException.cpp $(HDIR)\LocalException.h: $(SDIR)\LocalException.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\LocalException.ice + move LocalException.h $(HDIR) + +$(HDIR)\LocatorF.h: $(SDIR)\LocatorF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\LocatorF.ice + move LocatorF.h $(HDIR) + del /q LocatorF.cpp + +Locator.cpp $(HDIR)\Locator.h: $(SDIR)\Locator.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Locator.ice + move Locator.h $(HDIR) + +$(HDIR)\LoggerF.h: $(SDIR)\LoggerF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\LoggerF.ice + move LoggerF.h $(HDIR) + del /q LoggerF.cpp + +Logger.cpp $(HDIR)\Logger.h: $(SDIR)\Logger.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Logger.ice + move Logger.h $(HDIR) + +$(HDIR)\ObjectAdapterF.h: $(SDIR)\ObjectAdapterF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ObjectAdapterF.ice + move ObjectAdapterF.h $(HDIR) + del /q ObjectAdapterF.cpp + +ObjectAdapter.cpp $(HDIR)\ObjectAdapter.h: $(SDIR)\ObjectAdapter.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ObjectAdapter.ice + move ObjectAdapter.h $(HDIR) + +$(HDIR)\ObjectFactoryF.h: $(SDIR)\ObjectFactoryF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ObjectFactoryF.ice + move ObjectFactoryF.h $(HDIR) + del /q ObjectFactoryF.cpp + +ObjectFactory.cpp $(HDIR)\ObjectFactory.h: $(SDIR)\ObjectFactory.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ObjectFactory.ice + move ObjectFactory.h $(HDIR) + +$(HDIR)\PluginF.h: $(SDIR)\PluginF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\PluginF.ice + move PluginF.h $(HDIR) + del /q PluginF.cpp + +Plugin.cpp $(HDIR)\Plugin.h: $(SDIR)\Plugin.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Plugin.ice + move Plugin.h $(HDIR) + +$(HDIR)\ProcessF.h: $(SDIR)\ProcessF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ProcessF.ice + move ProcessF.h $(HDIR) + del /q ProcessF.cpp + +Process.cpp $(HDIR)\Process.h: $(SDIR)\Process.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Process.ice + move Process.h $(HDIR) + +$(HDIR)\PropertiesF.h: $(SDIR)\PropertiesF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\PropertiesF.ice + move PropertiesF.h $(HDIR) + del /q PropertiesF.cpp + +Properties.cpp $(HDIR)\Properties.h: $(SDIR)\Properties.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Properties.ice + move Properties.h $(HDIR) + +$(HDIR)\RouterF.h: $(SDIR)\RouterF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\RouterF.ice + move RouterF.h $(HDIR) + del /q RouterF.cpp + +Router.cpp $(HDIR)\Router.h: $(SDIR)\Router.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Router.ice + move Router.h $(HDIR) + +$(HDIR)\ServantLocatorF.h: $(SDIR)\ServantLocatorF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ServantLocatorF.ice + move ServantLocatorF.h $(HDIR) + del /q ServantLocatorF.cpp + +ServantLocator.cpp $(HDIR)\ServantLocator.h: $(SDIR)\ServantLocator.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\ServantLocator.ice + move ServantLocator.h $(HDIR) + +SliceChecksumDict.cpp $(HDIR)\SliceChecksumDict.h: $(SDIR)\SliceChecksumDict.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\SliceChecksumDict.ice + move SliceChecksumDict.h $(HDIR) + +$(HDIR)\StatsF.h: $(SDIR)\StatsF.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\StatsF.ice + move StatsF.h $(HDIR) + del /q StatsF.cpp + +Stats.cpp $(HDIR)\Stats.h: $(SDIR)\Stats.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Stats.ice + move Stats.h $(HDIR) + +clean:: + del /q BuiltinSequences.cpp $(HDIR)\BuiltinSequences.h + del /q $(HDIR)\CommunicatorF.h + del /q Communicator.cpp $(HDIR)\Communicator.h + del /q $(HDIR)\ConnectionF.h + del /q Connection.cpp $(HDIR)\Connection.h + del /q Current.cpp $(HDIR)\Current.h + del /q Endpoint.cpp $(HDIR)\Endpoint.h + del /q FacetMap.cpp $(HDIR)\FacetMap.h + del /q Identity.cpp $(HDIR)\Identity.h + del /q LocalException.cpp $(HDIR)\LocalException.h + del /q $(HDIR)\LocatorF.h + del /q Locator.cpp $(HDIR)\Locator.h + del /q $(HDIR)\LoggerF.h + del /q Logger.cpp $(HDIR)\Logger.h + del /q $(HDIR)\ObjectAdapterF.h + del /q ObjectAdapter.cpp $(HDIR)\ObjectAdapter.h + del /q $(HDIR)\ObjectFactoryF.h + del /q ObjectFactory.cpp $(HDIR)\ObjectFactory.h + del /q $(HDIR)\PluginF.h + del /q Plugin.cpp $(HDIR)\Plugin.h + del /q $(HDIR)\ProcessF.h + del /q Process.cpp $(HDIR)\Process.h + del /q $(HDIR)\PropertiesF.h + del /q Properties.cpp $(HDIR)\Properties.h + del /q $(HDIR)\RouterF.h + del /q Router.cpp $(HDIR)\Router.h + del /q $(HDIR)\ServantLocatorF.h + del /q ServantLocator.cpp $(HDIR)\ServantLocator.h + del /q SliceChecksumDict.cpp $(HDIR)\SliceChecksumDict.h + del /q $(HDIR)\StatsF.h + del /q Stats.cpp $(HDIR)\Stats.h + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + +!include .depend diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index fbe051e2a50..a1461abd88f 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -36,6 +36,10 @@ # include <sys/time.h> #endif +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif + using namespace std; using namespace Ice; using namespace IceInternal; diff --git a/cpp/src/Ice/Protocol.cpp b/cpp/src/Ice/Protocol.cpp index e405673ec4f..53a6e2bc96d 100644 --- a/cpp/src/Ice/Protocol.cpp +++ b/cpp/src/Ice/Protocol.cpp @@ -14,7 +14,11 @@ namespace IceInternal const Ice::Byte magic[] = { 0x49, 0x63, 0x65, 0x50 }; // 'I', 'c', 'e', 'P' +#ifdef __BCPLUSPLUS__ +const Ice::Byte requestHdr[headerSize + sizeof(Ice::Int)] = +#else const Ice::Byte requestHdr[] = +#endif { magic[0], magic[1], @@ -30,7 +34,11 @@ const Ice::Byte requestHdr[] = 0, 0, 0, 0 // Request id (placeholder) }; +#ifdef __BCPLUSPLUS__ +const Ice::Byte requestBatchHdr[headerSize + sizeof(Ice::Int)] = +#else const Ice::Byte requestBatchHdr[] = +#endif { magic[0], magic[1], diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 169a5c71a0c..dffa814cee1 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1590,17 +1590,26 @@ IceInternal::IndirectReference::getConnection(bool& comp) const if(!getRouterInfo()) { assert(_locatorInfo); - const IndirectReferencePtr self = const_cast<IndirectReference*>(this); - _locatorInfo->clearCache(self); + + // COMPILERFIX: Braces needed to prevent BCB from causing Reference refCount from + // being decremented twice when loop continues. + { + const IndirectReferencePtr self = const_cast<IndirectReference*>(this); + _locatorInfo->clearCache(self); + } if(cached) { - TraceLevelsPtr traceLevels = getInstance()->traceLevels(); - if(traceLevels->retry >= 2) + // COMPILERFIX: Braces needed to prevent BCB from causing TraceLevels refCount from + // being decremented twice when loop continues. { - Trace out(getInstance()->initializationData().logger, traceLevels->retryCat); - out << "connection to cached endpoints failed\n" - << "removing endpoints from cache and trying one more time\n" << ex; + TraceLevelsPtr traceLevels = getInstance()->traceLevels(); + if(traceLevels->retry >= 2) + { + Trace out(getInstance()->initializationData().logger, traceLevels->retryCat); + out << "connection to cached endpoints failed\n" + << "removing endpoints from cache and trying one more time\n" << ex; + } } continue; } diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index 334fa9984d3..6b720ec6321 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -31,7 +31,7 @@ void IceInternal::decRef(::IceInternal::ReferenceFactory* p) { p->__decRef(); } ReferencePtr IceInternal::ReferenceFactory::copy(const Reference* r) const { - Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_instance) { @@ -57,7 +57,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, const RouterInfoPtr& routerInfo, bool collocationOptimization) { - Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_instance) { @@ -88,7 +88,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, bool collocationOptimization, int locatorCacheTimeout) { - Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_instance) { @@ -114,7 +114,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, Reference::Mode mode, const vector<Ice::ConnectionIPtr>& fixedConnections) { - Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_instance) { @@ -643,7 +643,7 @@ IceInternal::ReferenceFactory::ReferenceFactory(const InstancePtr& instance, con void IceInternal::ReferenceFactory::destroy() { - Mutex::Lock sync(*this); + IceUtil::Mutex::Lock sync(*this); if(!_instance) { diff --git a/cpp/src/Ice/ServantManager.cpp b/cpp/src/Ice/ServantManager.cpp index 21a49cab273..c1d3b7aa736 100644 --- a/cpp/src/Ice/ServantManager.cpp +++ b/cpp/src/Ice/ServantManager.cpp @@ -19,6 +19,9 @@ using namespace Ice; using namespace IceInternal; void IceInternal::incRef(ServantManager* p) { p->__incRef(); } +#ifdef __BCPLUSPLUS__ +ICE_API +#endif void IceInternal::decRef(ServantManager* p) { p->__decRef(); } void diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 03a762bf3f1..abef235ca7d 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -24,6 +24,9 @@ using namespace Ice; using namespace IceInternal; void IceInternal::incRef(ThreadPool* p) { p->__incRef(); } +#ifdef __BCPLUSPLUS__ +ICE_API +#endif void IceInternal::decRef(ThreadPool* p) { p->__decRef(); } IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& prefix, int timeout) : diff --git a/cpp/src/Ice/TraceLevels.cpp b/cpp/src/Ice/TraceLevels.cpp index 6c8653fdafb..4b6abe1617f 100644 --- a/cpp/src/Ice/TraceLevels.cpp +++ b/cpp/src/Ice/TraceLevels.cpp @@ -15,6 +15,9 @@ using namespace Ice; using namespace IceInternal; void IceInternal::incRef(TraceLevels* p) { p->__incRef(); } +#ifdef __BCPLUSPLUS__ +ICE_API +#endif void IceInternal::decRef(TraceLevels* p) { p->__decRef(); } IceInternal::TraceLevels::TraceLevels(const PropertiesPtr& properties) : diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp index 9bf94b87920..bc5c89c9af6 100644 --- a/cpp/src/IceBox/Admin.cpp +++ b/cpp/src/IceBox/Admin.cpp @@ -56,7 +56,7 @@ Client::run(int argc, char* argv[]) vector<string> commands; try { - commands = opts.parse(argc, argv); + commands = opts.parse(argc, (const char**)argv); } catch(const IceUtil::Options::BadOpt& e) { diff --git a/cpp/src/IceBox/Exception.cpp b/cpp/src/IceBox/Exception.cpp index 60070c1cb31..1452f81f66d 100644 --- a/cpp/src/IceBox/Exception.cpp +++ b/cpp/src/IceBox/Exception.cpp @@ -14,7 +14,11 @@ using namespace std; void IceBox::FailureException::ice_print(ostream& out) const { +#ifdef __BCPLUSPLUS__ + Ice::Exception::ice_print(out); +#else Exception::ice_print(out); +#endif out << ":\nservice failure exception: " << reason; } diff --git a/cpp/src/IceBox/Makefile.mak b/cpp/src/IceBox/Makefile.mak new file mode 100644 index 00000000000..27db2de4bd4 --- /dev/null +++ b/cpp/src/IceBox/Makefile.mak @@ -0,0 +1,96 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\icebox$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\icebox$(SOVERSION)$(LIBSUFFIX).dll + +SERVER = $(top_srcdir)\bin\icebox$(LIBSUFFIX).exe +ADMIN = $(top_srcdir)\bin\iceboxadmin.exe + +!ifdef BUILD_UTILS + +TARGETS = $(SERVER) $(ADMIN) + +!else + +TARGETS = $(LIBNAME) $(DLLNAME) + +!endif + +OBJS = IceBox.o \ + Exception.o + +SOBJS = ServiceManagerI.o \ + Service.o + +AOBJS = Admin.o + +SRCS = $(OBJS:.o=.cpp) \ + $(SOBJS:.o=.cpp) \ + $(AOBJS:.o=.cpp) + +HDIR = $(includedir)\IceBox +SDIR = $(slicedir)\IceBox + +!include $(top_srcdir)\config\Make.rules.mak + +!ifdef BUILD_UTILS + +CPPFLAGS = -I.. $(CPPFLAGS) + +!else + +CPPFLAGS = -I.. $(CPPFLAGS) -DICE_BOX_API_EXPORTS + +!endif + +SLICE2CPPFLAGS = --checksum --ice --dll-export ICE_BOX_API --include-dir IceBox $(SLICE2CPPFLAGS) + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LIBS) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +$(SERVER): $(SOBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(SOBJS), $@,, $(LIBS) icebox$(LIBSUFFIX).lib + +$(ADMIN): $(AOBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(AOBJS), $@,, $(LIBS) icebox$(LIBSUFFIX).lib + +IceBox.cpp $(HDIR)\IceBox.h: $(SDIR)\IceBox.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\IceBox.ice + move IceBox.h $(HDIR) + +!ifdef BUILD_UTILS + +clean:: + del /q IceBox.cpp $(HDIR)\IceBox.h + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + copy $(SERVER) $(install_bindir) + copy $(ADMIN) $(install_bindir) + +!else + +install:: all + +$(EVERYTHING):: + $(MAKE) /f Makefile.mak BUILD_UTILS=1 $@ + +!endif + +!include .depend diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp index 96e401290de..52aa9dd2bc4 100644 --- a/cpp/src/IceBox/Service.cpp +++ b/cpp/src/IceBox/Service.cpp @@ -52,7 +52,7 @@ IceBox::IceBoxService::start(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/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index b0e6eb505fa..e79fa2d9903 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -72,7 +72,7 @@ Client::run(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/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index 0a23a5760f3..e54553fc476 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -2446,8 +2446,8 @@ ApplicationHelper::update(const ApplicationUpdateDescriptor& updt) const { resolve.exception("can't remove servers for node `" + p->name + "': node doesn't exist"); } - desc.loadFactor = p->loadFactor ? p->loadFactor->value : ""; - desc.description = p->description ? p->description->value : ""; + desc.loadFactor = p->loadFactor ? p->loadFactor->value : string(""); + desc.description = p->description ? p->description->value : string(""); def.nodes.insert(make_pair(p->name, desc)); } } diff --git a/cpp/src/IceGrid/DescriptorParser.cpp b/cpp/src/IceGrid/DescriptorParser.cpp index 8d1b715cad6..003e280d25f 100644 --- a/cpp/src/IceGrid/DescriptorParser.cpp +++ b/cpp/src/IceGrid/DescriptorParser.cpp @@ -780,10 +780,10 @@ DescriptorHandler::elementValue() bool DescriptorHandler::isTargetDeployable(const string& target) const { - string application = _currentApplication.get() ? _currentApplication->getDescriptor().name : ""; - string node = _currentNode.get() ? _currentNode->getName() : ""; - string server = _currentServer.get() ? _currentServer->getDescriptor()->id : ""; - string service = _currentService.get() ? _currentService->getDescriptor()->name : ""; + string application = _currentApplication.get() ? _currentApplication->getDescriptor().name : string(""); + string node = _currentNode.get() ? _currentNode->getName() : string(""); + string server = _currentServer.get() ? _currentServer->getDescriptor()->id : string(""); + string service = _currentService.get() ? _currentService->getDescriptor()->name : string(""); // // Compute the current fully qualified name of the communicator. diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 219b70a4457..b0a7f1bdb54 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -19,6 +19,12 @@ #include <IceGrid/NodeI.h> #include <IceGrid/NodeSessionManager.h> #include <IceGrid/TraceLevels.h> +#ifdef __BCPLUSPLUS__ +# include <IceGrid/ServerI.h> +# include <IceGrid/AdminSessionI.h> +# include <IceGrid/ReapThread.h> +# include <IceGrid/Database.h> +#endif #include <IceGrid/DescriptorParser.h> #include <IcePatch2/Util.h> @@ -26,8 +32,10 @@ # include <direct.h> # include <sys/types.h> # include <sys/stat.h> -# define S_ISDIR(mode) ((mode) & _S_IFDIR) -# define S_ISREG(mode) ((mode) & _S_IFREG) +# ifdef _MSC_VER +# define S_ISDIR(mode) ((mode) & _S_IFDIR) +# define S_ISREG(mode) ((mode) & _S_IFREG) +# endif #else # include <sys/stat.h> #endif diff --git a/cpp/src/IceGrid/IceGridRegistry.cpp b/cpp/src/IceGrid/IceGridRegistry.cpp index dc718fa94b4..961eef75e08 100644 --- a/cpp/src/IceGrid/IceGridRegistry.cpp +++ b/cpp/src/IceGrid/IceGridRegistry.cpp @@ -11,6 +11,13 @@ #include <Ice/Ice.h> #include <Ice/Service.h> #include <IceGrid/RegistryI.h> +#ifdef __BCPLUSPLUS__ +# include <IceGrid/AdminSessionI.h> +# include <IceGrid/WaitQueue.h> +# include <IceGrid/ReapThread.h> +# include <IceGrid/TraceLevels.h> +# include <IceGrid/Database.h> +#endif using namespace std; using namespace Ice; @@ -57,7 +64,7 @@ RegistryService::start(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/IceGrid/LocatorRegistryI.cpp b/cpp/src/IceGrid/LocatorRegistryI.cpp index 2bb8efa0183..5b187460681 100644 --- a/cpp/src/IceGrid/LocatorRegistryI.cpp +++ b/cpp/src/IceGrid/LocatorRegistryI.cpp @@ -166,7 +166,7 @@ LocatorRegistryI::setAdapterDirectProxy_async(const Ice::AMD_LocatorRegistry_set { Ice::Trace out(traceLevels->logger, traceLevels->locatorCat); out << "registered adapter `" << adapterId << "' endpoints: `" - << (proxy ? proxy->ice_toString() : "") << "'"; + << (proxy ? proxy->ice_toString() : string("")) << "'"; } return; } @@ -220,7 +220,7 @@ LocatorRegistryI::setReplicatedAdapterDirectProxy_async( { Ice::Trace out(traceLevels->logger, traceLevels->locatorCat); out << "registered replicated adapter `" << adapterId << "' endpoints: `" - << (proxy ? proxy->ice_toString() : "") << "'"; + << (proxy ? proxy->ice_toString() : string("")) << "'"; } return; } @@ -270,7 +270,8 @@ LocatorRegistryI::setServerProcessProxy_async(const Ice::AMD_LocatorRegistry_set if(traceLevels->locator > 1) { Ice::Trace out(traceLevels->logger, traceLevels->locatorCat); - out << "registered server `" << id << "' process proxy: `" << (proxy ? proxy->ice_toString() : "") << "'"; + out << "registered server `" << id << "' process proxy: `" << (proxy ? proxy->ice_toString() : string("")) + << "'"; } return; } diff --git a/cpp/src/IceGrid/Makefile b/cpp/src/IceGrid/Makefile index 669ede90dc7..ab46dede30b 100644 --- a/cpp/src/IceGrid/Makefile +++ b/cpp/src/IceGrid/Makefile @@ -105,6 +105,7 @@ SLICE_SRCS = $(SDIR)/Admin.ice \ $(SDIR)/Exception.ice \ $(SDIR)/FileParser.ice \ $(SDIR)/Query.ice \ + $(SDIR)/Registry.ice \ $(SDIR)/Session.ice \ $(SDIR)/Observer.ice \ $(SDIR)/Descriptor.ice \ diff --git a/cpp/src/IceGrid/Makefile.mak b/cpp/src/IceGrid/Makefile.mak new file mode 100644 index 00000000000..6a84a90818d --- /dev/null +++ b/cpp/src/IceGrid/Makefile.mak @@ -0,0 +1,260 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\icegrid$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\icegrid$(SOVERSION)$(LIBSUFFIX).dll + +ADMIN = $(top_srcdir)\bin\icegridadmin.exe +NODE_SERVER = $(top_srcdir)\bin\icegridnode.exe +REGISTRY_SERVER = $(top_srcdir)\bin\icegridregistry.exe + +!ifdef BUILD_UTILS + +TARGETS = $(ADMIN) $(NODE_SERVER) $(REGISTRY_SERVER) + +!else + +TARGETS = $(LIBNAME) $(DLLNAME) + +!endif + +LIB_OBJS = Admin.o \ + Query.o \ + Exception.o \ + Descriptor.o \ + Observer.o \ + Session.o \ + Registry.o \ + UserAccountMapper.o + +ADMIN_OBJS = Grammar.o \ + Scanner.o \ + Parser.o \ + DescriptorParser.o \ + DescriptorBuilder.o \ + DescriptorHelper.o \ + FileParser.o \ + FileParserI.o \ + Util.o \ + Internal.o \ + Client.o + +COMMON_OBJS = Internal.o \ + DescriptorParser.o \ + DescriptorBuilder.o \ + TraceLevels.o + +NODE_OBJS = NodeI.o \ + ServerI.o \ + ServerAdapterI.o \ + Activator.o \ + PlatformInfo.o \ + NodeSessionManager.o + +REGISTRY_OBJS = RegistryI.o \ + InternalRegistryI.o \ + StringApplicationInfoDict.o \ + IdentityObjectInfoDict.o \ + StringAdapterInfoDict.o \ + Database.o \ + Allocatable.o \ + AdapterCache.o \ + ObjectCache.o \ + AllocatableObjectCache.o \ + ServerCache.o \ + NodeCache.o \ + ReplicaCache.o \ + LocatorI.o \ + LocatorRegistryI.o \ + AdminI.o \ + Util.o \ + DescriptorHelper.o \ + NodeSessionI.o \ + ReplicaSessionI.o \ + ReapThread.o \ + SessionI.o \ + AdminSessionI.o \ + SessionServantLocatorI.o \ + Topics.o \ + QueryI.o \ + WaitQueue.o \ + FileUserAccountMapperI.o \ + ReplicaSessionManager.o + +NODE_SVR_OBJS = $(COMMON_OBJS) \ + $(NODE_OBJS) \ + $(REGISTRY_OBJS) \ + IceGridNode.o + +REGISTRY_SVR_OBJS = \ + $(COMMON_OBJS) \ + $(REGISTRY_OBJS) \ + IceGridRegistry.o + +SRCS = $(LIB_OBJS:.o=.cpp) \ + $(ADMIN_OBJS:.o=.cpp) \ + $(COMMON_OBJS:.o=.cpp) \ + $(NODE_OBJS:.o=.cpp) \ + $(REGISTRY_OBJS:.o=.cpp) \ + IceGridNode.cpp \ + IceGridRegistry.cpp + +HDIR = $(includedir)\IceGrid +SDIR = $(slicedir)\IceGrid + +SLICE2FREEZECMD = $(SLICE2FREEZE) --ice --include-dir IceGrid $(ICECPPFLAGS) + +!include $(top_srcdir)\config\Make.rules.mak + +SLICE2CPPFLAGS = --checksum --ice --include-dir IceGrid --dll-export ICE_GRID_API $(SLICE2CPPFLAGS) +LINKWITH = $(LIBS) glacier2$(LIBSUFFIX).lib +ALINKWITH = $(LINKWITH) icegrid$(LIBSUFFIX).lib icexml$(LIBSUFFIX).lib icepatch2$(LIBSUFFIX).lib +NLINKWITH = $(ALINKWITH) icestorm$(LIBSUFFIX).lib freeze$(LIBSUFFIX).lib icebox$(LIBSUFFIX).lib \ + icessl$(LIBSUFFIX).lib icestormservice$(LIBSUFFIX).lib $(OPENSSL_LIBS) + +!ifdef BUILD_UTILS + +CPPFLAGS = -I. -I.. $(CPPFLAGS) + +!else + +CPPFLAGS = -I.. -DICE_GRID_API_EXPORTS $(CPPFLAGS) + +!endif + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(LIB_OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(LIB_OBJS), $(DLLNAME),, $(LINKWITH) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +$(ADMIN): $(ADMIN_OBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(ADMIN_OBJS), $@,, $(ALINKWITH) + +$(REGISTRY_SERVER): $(REGISTRY_SVR_OBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(REGISTRY_SVR_OBJS), $@,, $(NLINKWITH) + +$(NODE_SERVER): $(NODE_SVR_OBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(NODE_SVR_OBJS), $@,, $(NLINKWITH) + +StringApplicationInfoDict.h StringApplicationInfoDict.cpp: $(SLICE2FREEZE) + del /q StringApplicationInfoDict.h StringApplicationInfoDict.cpp + $(SLICE2FREEZECMD) --dict IceGrid::StringApplicationInfoDict,string,IceGrid::ApplicationInfo \ + StringApplicationInfoDict Internal.ice + +IdentityObjectInfoDict.h IdentityObjectInfoDict.cpp: $(SLICE2FREEZE) + del /q IdentityObjectInfoDict.h IdentityObjectInfoDict.cpp + $(SLICE2FREEZECMD) --dict IceGrid::IdentityObjectInfoDict,Ice::Identity,IceGrid::ObjectInfo \ + --dict-index IceGrid::IdentityObjectInfoDict,type \ + IdentityObjectInfoDict ..\..\slice\Ice\Identity.ice Internal.ice + +StringAdapterInfoDict.h StringAdapterInfoDict.cpp: $(SLICE2FREEZE) + del /q StringAdapterInfoDict.h StringAdapterInfoDict.cpp + $(SLICE2FREEZECMD) --dict IceGrid::StringAdapterInfoDict,string,IceGrid::AdapterInfo \ + --dict-index IceGrid::StringAdapterInfoDict,replicaGroupId StringAdapterInfoDict $(SDIR)\Admin.ice + +Admin.cpp $(HDIR)\Admin.h: $(SDIR)\Admin.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Admin.ice + move Admin.h $(HDIR) + +Exception.cpp $(HDIR)\Exception.h: $(SDIR)\Exception.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Exception.ice + move Exception.h $(HDIR) + +FileParser.cpp $(HDIR)\FileParser.h: $(SDIR)\FileParser.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\FileParser.ice + move FileParser.h $(HDIR) + +Query.cpp $(HDIR)\Query.h: $(SDIR)\Query.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Query.ice + move Query.h $(HDIR) + +Session.cpp $(HDIR)\Session.h: $(SDIR)\Session.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Session.ice + move Session.h $(HDIR) + +Observer.cpp $(HDIR)\Observer.h: $(SDIR)\Observer.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Observer.ice + move Observer.h $(HDIR) + +Descriptor.cpp $(HDIR)\Descriptor.h: $(SDIR)\Descriptor.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Descriptor.ice + move Descriptor.h $(HDIR) + +UserAccountMapper.cpp $(HDIR)\UserAccountMapper.h: $(SDIR)\UserAccountMapper.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\UserAccountMapper.ice + move UserAccountMapper.h $(HDIR) + +Registry.cpp $(HDIR)\Registry.h: $(SDIR)\Registry.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\Registry.ice + move Registry.h $(HDIR) + +Internal.cpp Internal.h: Internal.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) Internal.ice + +Scanner.cpp : Scanner.l + flex $(FLEXFLAGS) Scanner.l + del /q $@ + echo #include "IceUtil/Config.h" > Scanner.cpp + type lex.yy.c >> Scanner.cpp + del /q lex.yy.c + +Grammar.cpp Grammar.h: Grammar.y + del /q Grammar.h Grammar.cpp + bison -dvt Grammar.y + move Grammar.tab.c Grammar.cpp + move Grammar.tab.h Grammar.h + del /q Grammar.output + +!ifdef BUILD_UTILS + +clean:: + del /q StringApplicationInfoDict.h StringApplicationInfoDict.cpp + del /q StringAdapterInfoDict.h StringAdapterInfoDict.cpp + del /q IdentityObjectInfoDict.h IdentityObjectInfoDict.cpp + +clean:: + del /q Admin.cpp $(HDIR)\Admin.h + del /q Exception.cpp $(HDIR)\Exception.h + del /q FileParser.cpp $(HDIR)\FileParser.h + del /q Query.cpp $(HDIR)\Query.h + del /q Session.cpp $(HDIR)\Session.h + del /q Observer.cpp $(HDIR)\Observer.h + del /q Descriptor.cpp $(HDIR)\Descriptor.h + del /q UserAccountMapper.cpp $(HDIR)\UserAccountMapper.h + del /q Registry.cpp $(HDIR)\Registry.h + del /q Internal.cpp Internal.h + +clean:: + del /q Grammar.cpp Grammar.h + del /q Scanner.cpp + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + copy $(ADMIN) $(install_bindir) + copy $(NODE_SERVER) $(install_bindir) + copy $(REGISTRY_SERVER) $(install_bindir) + +!else + +install:: all + +$(EVERYTHING):: + $(MAKE) /f Makefile.mak BUILD_UTILS=1 $@ + +!endif + +!include .depend diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index 9b8ede8039c..1da1ed0aa8f 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -445,7 +445,8 @@ NodeEntry::loadServer(const ServerEntryPtr& entry, const ServerInfo& server, con } AMI_Node_loadServerPtr amiCB = new LoadCB(_cache.getTraceLevels(), entry, entry->getId(), _name); - node->loadServer_async(amiCB, server.application, desc, session ? session->getId() : ""); + string sessionId = session ? session->getId() : string(""); + node->loadServer_async(amiCB, server.application, desc, sessionId); } catch(const NodeUnreachableException& ex) { diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 9c002fefafc..ce218173db3 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -144,7 +144,8 @@ public: { roundedSize = 1; } - out << _dest << ": downloading " << (_path.empty() ? "" : (_path + " ")) << roundedSize << "KB "; + out << _dest << ": downloading " << (_path.empty() ? string("") : (_path + " ")) << roundedSize + << "KB "; _startedPatch = true; } } diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index 0b6bcc8f030..f736f7bbe41 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -949,15 +949,15 @@ Parser::endpointsAdapter(const list<string>& args) if(adpts.size() == 1 && adpts.begin()->id == adapterId) { string endpoints = _communicator->proxyToString(adpts.begin()->proxy); - cout << (endpoints.empty() ? "<inactive>" : endpoints) << endl; + cout << (endpoints.empty() ? string("<inactive>") : endpoints) << endl; } else { for(AdapterInfoSeq::const_iterator p = adpts.begin(); p != adpts.end(); ++p) { - cout << (p->id.empty() ? "<empty>" : p->id) << ": "; + cout << (p->id.empty() ? string("<empty>") : p->id) << ": "; string endpoints = _communicator->proxyToString(p->proxy); - cout << (endpoints.empty() ? "<inactive>" : endpoints) << endl; + cout << (endpoints.empty() ? string("<inactive>") : endpoints) << endl; } } } diff --git a/cpp/src/IceGrid/Parser.h b/cpp/src/IceGrid/Parser.h index 9a4aaa50614..c793e540d5a 100644 --- a/cpp/src/IceGrid/Parser.h +++ b/cpp/src/IceGrid/Parser.h @@ -14,13 +14,14 @@ #include <IceGrid/Admin.h> #include <IceGrid/Query.h> #include <list> +#include <stdio.h> #ifdef _WIN32 # include <io.h> -# define isatty _isatty -# define fileno _fileno -// '_isatty' : inconsistent dll linkage. dllexport assumed. # ifdef _MSC_VER +# define isatty _isatty +# define fileno _fileno +// '_isatty' : inconsistent dll linkage. dllexport assumed. # pragma warning( disable : 4273 ) # endif #endif diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp index 9dc35eeecb8..dfacb440acc 100644 --- a/cpp/src/IceGrid/RegistryI.cpp +++ b/cpp/src/IceGrid/RegistryI.cpp @@ -40,8 +40,10 @@ #ifdef _WIN32 # include <direct.h> -# define S_ISDIR(mode) ((mode) & _S_IFDIR) -# define S_ISREG(mode) ((mode) & _S_IFREG) +# ifdef _MSC_VER +# define S_ISDIR(mode) ((mode) & _S_IFDIR) +# define S_ISREG(mode) ((mode) & _S_IFREG) +# endif #else # include <unistd.h> #endif diff --git a/cpp/src/IceGrid/Scanner.l b/cpp/src/IceGrid/Scanner.l index 213934d1dfb..3b0e8d4435b 100644 --- a/cpp/src/IceGrid/Scanner.l +++ b/cpp/src/IceGrid/Scanner.l @@ -33,6 +33,7 @@ WS [ \t\v\f\r] NL [\n] %option noyywrap +%option never-interactive %% diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 67953e08d04..f5eb0042622 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -130,365 +130,6 @@ private: const TimedServerCommandPtr _command; }; -class LoadCommand : public ServerCommand -{ -public: - - LoadCommand(const ServerIPtr& server) : - ServerCommand(server) - { - } - - virtual bool - canExecute(ServerI::InternalServerState state) - { - return state == ServerI::Inactive; - } - - virtual ServerI::InternalServerState - nextState() - { - return ServerI::Loading; - } - - virtual void - execute() - { - _server->update(); - } - - void - setUpdate(const string& application, const ServerDescriptorPtr& desc, const std::string& sessionId, bool clearDir) - { - _clearDir = clearDir; - _application = application; - _desc = desc; - _sessionId = sessionId; - } - - bool - clearDir() const - { - return _clearDir; - } - - string - sessionId() const - { - return _sessionId; - } - - string - getApplication() const - { - return _application; - } - - ServerDescriptorPtr - getDescriptor() const - { - return _desc; - } - - void - addCallback(const AMD_Node_loadServerPtr& amdCB) - { - _loadCB.push_back(amdCB); - } - - void - failed(const Ice::Exception& ex) - { - for(vector<AMD_Node_loadServerPtr>::const_iterator p = _loadCB.begin(); p != _loadCB.end(); ++p) - { - (*p)->ice_exception(ex); - } - } - - void - finished(const ServerPrx& proxy, const AdapterPrxDict& adapters, int at, int dt) - { - for(vector<AMD_Node_loadServerPtr>::const_iterator p = _loadCB.begin(); p != _loadCB.end(); ++p) - { - (*p)->ice_response(proxy, adapters, at, dt); - } - } - -private: - - vector<AMD_Node_loadServerPtr> _loadCB; - bool _clearDir; - string _application; - ServerDescriptorPtr _desc; - string _sessionId; - auto_ptr<DeploymentException> _exception; -}; - -class DestroyCommand : public ServerCommand -{ -public: - - DestroyCommand(const ServerIPtr& server, bool kill) : - ServerCommand(server), - _kill(kill) - { - } - - virtual bool - canExecute(ServerI::InternalServerState state) - { - return - state == ServerI::Inactive || - state == ServerI::WaitForActivation || - state == ServerI::Active || - state == ServerI::ActivationTimeout || - state == ServerI::Deactivating || - state == ServerI::DeactivatingWaitForProcess; - } - - virtual ServerI::InternalServerState - nextState() - { - return ServerI::Destroying; - } - - virtual void - execute() - { - if(_kill) - { - _server->kill(); - } - else - { - _server->destroy(); - } - } - - void - addCallback(const AMD_Node_destroyServerPtr& amdCB) - { - _destroyCB.push_back(amdCB); - } - - void - finished() - { - for(vector<AMD_Node_destroyServerPtr>::const_iterator p = _destroyCB.begin(); p != _destroyCB.end(); ++p) - { - (*p)->ice_response(); - } - } - -private: - - const bool _kill; - vector<AMD_Node_destroyServerPtr> _destroyCB; -}; - -class PatchCommand : public ServerCommand, public IceUtil::Monitor<IceUtil::Mutex> -{ -public: - - PatchCommand(const ServerIPtr& server) : - ServerCommand(server), - _notified(false), - _destroyed(false) - { - } - - virtual bool - canExecute(ServerI::InternalServerState state) - { - return state == ServerI::Inactive; - } - - virtual ServerI::InternalServerState - nextState() - { - return ServerI::Patching; - } - - virtual void - execute() - { - Lock sync(*this); - _notified = true; - notifyAll(); - } - - bool - waitForPatch() - { - Lock sync(*this); - while(!_notified && !_destroyed) - { - wait(); - } - return _destroyed; - } - - void - destroyed() - { - Lock sync(*this); - _destroyed = true; - notifyAll(); - } - - void - finished() - { - } - -private: - - bool _notified; - bool _destroyed; -}; - -class StartCommand : public TimedServerCommand -{ -public: - - StartCommand(const ServerIPtr& server, const WaitQueuePtr& waitQueue, int timeout) : - TimedServerCommand(server, waitQueue, timeout) - { - } - - virtual bool - canExecute(ServerI::InternalServerState state) - { - return state == ServerI::Inactive; - } - - virtual ServerI::InternalServerState - nextState() - { - startTimer(); - return ServerI::Activating; - } - - virtual void - execute() - { - _server->activate(); - } - - virtual void - timeout(bool destroyed) - { - _server->activationFailed(destroyed); - } - - void - addCallback(const AMD_Server_startPtr& amdCB) - { - _startCB.push_back(amdCB); - } - - void - failed(const string& reason) - { - stopTimer(); - ServerStartException ex(_server->getId(), reason); - for(vector<AMD_Server_startPtr>::const_iterator p = _startCB.begin(); p != _startCB.end(); ++p) - { - (*p)->ice_exception(ex); - } - _startCB.clear(); - } - - void - finished() - { - stopTimer(); - for(vector<AMD_Server_startPtr>::const_iterator p = _startCB.begin(); p != _startCB.end(); ++p) - { - (*p)->ice_response(); - } - _startCB.clear(); - } - -private: - - vector<AMD_Server_startPtr> _startCB; -}; - -class StopCommand : public TimedServerCommand -{ -public: - - StopCommand(const ServerIPtr& server, const WaitQueuePtr& waitQueue, int timeout) : - TimedServerCommand(server, waitQueue, timeout) - { - } - - static bool - isStopped(ServerI::InternalServerState state) - { - return state == ServerI::Inactive || state == ServerI::Patching || state == ServerI::Loading; - } - - virtual bool - canExecute(ServerI::InternalServerState state) - { - return state == ServerI::WaitForActivation || state == ServerI::ActivationTimeout || state == ServerI::Active; - } - - virtual ServerI::InternalServerState - nextState() - { - startTimer(); - return ServerI::Deactivating; - } - - virtual void - execute() - { - _server->deactivate(); - } - - virtual void - timeout(bool) - { - _server->kill(); - } - - void - addCallback(const AMD_Server_stopPtr& amdCB) - { - _stopCB.push_back(amdCB); - } - - void - failed(const string& reason) - { - stopTimer(); - ServerStopException ex(_server->getId(), reason); - for(vector<AMD_Server_stopPtr>::const_iterator p = _stopCB.begin(); p != _stopCB.end(); ++p) - { - (*p)->ice_exception(ex); - } - _stopCB.clear(); - } - - void - finished() - { - stopTimer(); - for(vector<AMD_Server_stopPtr>::const_iterator p = _stopCB.begin(); p != _stopCB.end(); ++p) - { - (*p)->ice_response(); - } - _stopCB.clear(); - } - -private: - - vector<AMD_Server_stopPtr> _stopCB; -}; - class DelayedStart : public WaitItem { public: @@ -547,7 +188,7 @@ struct EnvironmentEval : std::unary_function<string, string> } string variable = v.substr(beg + 1, end - beg - 1); int ret = GetEnvironmentVariable(variable.c_str(), buf, sizeof(buf)); - string valstr = (ret > 0 && ret < sizeof(buf)) ? string(buf) : ""; + string valstr = (ret > 0 && ret < sizeof(buf)) ? string(buf) : string(""); v.replace(beg, end - beg + 1, valstr); beg += valstr.size(); } @@ -608,6 +249,314 @@ TimedServerCommand::stopTimer() _waitQueue->remove(_timer); } +LoadCommand::LoadCommand(const ServerIPtr& server) : + ServerCommand(server) +{ +} + +bool +LoadCommand::canExecute(ServerI::InternalServerState state) +{ + return state == ServerI::Inactive; +} + +ServerI::InternalServerState +LoadCommand::nextState() +{ + return ServerI::Loading; +} + +void +LoadCommand::execute() +{ + _server->update(); +} + +void +LoadCommand::setUpdate(const string& application, const ServerDescriptorPtr& desc, const std::string& sessionId, + bool clearDir) +{ + _clearDir = clearDir; + _application = application; + _desc = desc; + _sessionId = sessionId; +} + +bool +LoadCommand::clearDir() const +{ + return _clearDir; +} + +string +LoadCommand::sessionId() const +{ + return _sessionId; +} + +string +LoadCommand::getApplication() const +{ + return _application; +} + +ServerDescriptorPtr +LoadCommand::getDescriptor() const +{ + return _desc; +} + +void +LoadCommand::addCallback(const AMD_Node_loadServerPtr& amdCB) +{ + _loadCB.push_back(amdCB); +} + +void +LoadCommand::failed(const Ice::Exception& ex) +{ + for(vector<AMD_Node_loadServerPtr>::const_iterator p = _loadCB.begin(); p != _loadCB.end(); ++p) + { + (*p)->ice_exception(ex); + } +} + +void +LoadCommand::finished(const ServerPrx& proxy, const AdapterPrxDict& adapters, int at, int dt) +{ + for(vector<AMD_Node_loadServerPtr>::const_iterator p = _loadCB.begin(); p != _loadCB.end(); ++p) + { + (*p)->ice_response(proxy, adapters, at, dt); + } +} + +DestroyCommand::DestroyCommand(const ServerIPtr& server, bool kill) : + ServerCommand(server), + _kill(kill) +{ +} + +bool +DestroyCommand::canExecute(ServerI::InternalServerState state) +{ + return + state == ServerI::Inactive || + state == ServerI::WaitForActivation || + state == ServerI::Active || + state == ServerI::ActivationTimeout || + state == ServerI::Deactivating || + state == ServerI::DeactivatingWaitForProcess; +} + +ServerI::InternalServerState +DestroyCommand::nextState() +{ + return ServerI::Destroying; +} + +void +DestroyCommand::execute() +{ + if(_kill) + { + _server->kill(); + } + else + { + _server->destroy(); + } +} + +void +DestroyCommand::addCallback(const AMD_Node_destroyServerPtr& amdCB) +{ + _destroyCB.push_back(amdCB); +} + +void +DestroyCommand::finished() +{ + for(vector<AMD_Node_destroyServerPtr>::const_iterator p = _destroyCB.begin(); p != _destroyCB.end(); ++p) + { + (*p)->ice_response(); + } +} + +PatchCommand::PatchCommand(const ServerIPtr& server) : + ServerCommand(server), + _notified(false), + _destroyed(false) +{ +} + +bool +PatchCommand::canExecute(ServerI::InternalServerState state) +{ + return state == ServerI::Inactive; +} + +ServerI::InternalServerState +PatchCommand::nextState() +{ + return ServerI::Patching; +} + +void +PatchCommand::execute() +{ + Lock sync(*this); + _notified = true; + notifyAll(); +} + +bool +PatchCommand::waitForPatch() +{ + Lock sync(*this); + while(!_notified && !_destroyed) + { + wait(); + } + return _destroyed; +} + +void +PatchCommand::destroyed() +{ + Lock sync(*this); + _destroyed = true; + notifyAll(); +} + +void +PatchCommand::finished() +{ +} + +StartCommand::StartCommand(const ServerIPtr& server, const WaitQueuePtr& waitQueue, int timeout) : + TimedServerCommand(server, waitQueue, timeout) +{ +} + +bool +StartCommand::canExecute(ServerI::InternalServerState state) +{ + return state == ServerI::Inactive; +} + +ServerI::InternalServerState +StartCommand::nextState() +{ + startTimer(); + return ServerI::Activating; +} + +void +StartCommand::execute() +{ + _server->activate(); +} + +void +StartCommand::timeout(bool destroyed) +{ + _server->activationFailed(destroyed); +} + +void +StartCommand::addCallback(const AMD_Server_startPtr& amdCB) +{ + _startCB.push_back(amdCB); +} + +void +StartCommand::failed(const string& reason) +{ + stopTimer(); + ServerStartException ex(_server->getId(), reason); + for(vector<AMD_Server_startPtr>::const_iterator p = _startCB.begin(); p != _startCB.end(); ++p) + { + (*p)->ice_exception(ex); + } + _startCB.clear(); +} + +void +StartCommand::finished() +{ + stopTimer(); + for(vector<AMD_Server_startPtr>::const_iterator p = _startCB.begin(); p != _startCB.end(); ++p) + { + (*p)->ice_response(); + } + _startCB.clear(); +} + +StopCommand::StopCommand(const ServerIPtr& server, const WaitQueuePtr& waitQueue, int timeout) : + TimedServerCommand(server, waitQueue, timeout) +{ +} + +bool +StopCommand::isStopped(ServerI::InternalServerState state) +{ + return state == ServerI::Inactive || state == ServerI::Patching || state == ServerI::Loading; +} + +bool +StopCommand::canExecute(ServerI::InternalServerState state) +{ + return state == ServerI::WaitForActivation || state == ServerI::ActivationTimeout || state == ServerI::Active; +} + +ServerI::InternalServerState +StopCommand::nextState() +{ + startTimer(); + return ServerI::Deactivating; +} + +void +StopCommand::execute() +{ + _server->deactivate(); +} + +void +StopCommand::timeout(bool) +{ + _server->kill(); +} + +void +StopCommand::addCallback(const AMD_Server_stopPtr& amdCB) +{ + _stopCB.push_back(amdCB); +} + +void +StopCommand::failed(const string& reason) +{ + stopTimer(); + ServerStopException ex(_server->getId(), reason); + for(vector<AMD_Server_stopPtr>::const_iterator p = _stopCB.begin(); p != _stopCB.end(); ++p) + { + (*p)->ice_exception(ex); + } + _stopCB.clear(); +} + +void +StopCommand::finished() +{ + stopTimer(); + for(vector<AMD_Server_stopPtr>::const_iterator p = _stopCB.begin(); p != _stopCB.end(); ++p) + { + (*p)->ice_response(); + } + _stopCB.clear(); +} + ServerI::ServerI(const NodeIPtr& node, const ServerPrx& proxy, const string& serversDir, const string& id, int wt) : _node(node), _this(proxy), @@ -1459,7 +1408,7 @@ ServerI::terminated(const string& msg, int status) #else os << " with exit code " << status; #endif - os << (msg.empty() ? "." : ":\n" + msg); + os << (msg.empty() ? string(".") : ":\n" + msg); setStateNoSync(ServerI::Deactivating, os.str()); } } diff --git a/cpp/src/IceGrid/ServerI.h b/cpp/src/IceGrid/ServerI.h index f71aca358aa..643bede299e 100644 --- a/cpp/src/IceGrid/ServerI.h +++ b/cpp/src/IceGrid/ServerI.h @@ -199,6 +199,116 @@ private: }; typedef IceUtil::Handle<TimedServerCommand> TimedServerCommandPtr; +class DestroyCommand : public ServerCommand +{ +public: + + DestroyCommand(const ServerIPtr&, bool); + + bool canExecute(ServerI::InternalServerState state); + ServerI::InternalServerState nextState(); + void execute(); + + void addCallback(const AMD_Node_destroyServerPtr& amdCB); + void finished(); + +private: + + const bool _kill; + std::vector<AMD_Node_destroyServerPtr> _destroyCB; +}; + +class StopCommand : public TimedServerCommand +{ +public: + + StopCommand(const ServerIPtr&, const WaitQueuePtr&, int); + + static bool isStopped(ServerI::InternalServerState state); + + bool canExecute(ServerI::InternalServerState state); + ServerI::InternalServerState nextState(); + void execute(); + void timeout(bool destroyed); + + void addCallback(const AMD_Server_stopPtr&); + void failed(const std::string& reason); + void finished(); + +private: + + std::vector<AMD_Server_stopPtr> _stopCB; +}; + +class StartCommand : public TimedServerCommand +{ +public: + + StartCommand(const ServerIPtr&, const WaitQueuePtr&, int); + + bool canExecute(ServerI::InternalServerState state); + ServerI::InternalServerState nextState(); + void execute(); + void timeout(bool destroyed); + + void addCallback(const AMD_Server_startPtr&); + void failed(const std::string& reason); + void finished(); + +private: + + std::vector<AMD_Server_startPtr> _startCB; +}; + +class PatchCommand : public ServerCommand, public IceUtil::Monitor<IceUtil::Mutex> +{ +public: + + PatchCommand(const ServerIPtr&); + + bool canExecute(ServerI::InternalServerState state); + ServerI::InternalServerState nextState(); + void execute(); + + bool waitForPatch(); + void destroyed(); + void finished(); + +private: + + bool _notified; + bool _destroyed; +}; + +class LoadCommand : public ServerCommand +{ +public: + + LoadCommand(const ServerIPtr&); + + bool canExecute(ServerI::InternalServerState state); + ServerI::InternalServerState nextState(); + void execute(); + + void setUpdate(const std::string&, const ServerDescriptorPtr&, const std::string&, bool clearDir); + bool clearDir() const; + std::string sessionId() const; + std::string getApplication() const; + ServerDescriptorPtr getDescriptor() const; + void addCallback(const AMD_Node_loadServerPtr&); + void failed(const Ice::Exception&); + void finished(const ServerPrx&, const AdapterPrxDict&, int, int); + +private: + + std::vector<AMD_Node_loadServerPtr> _loadCB; + bool _clearDir; + std::string _application; + ServerDescriptorPtr _desc; + std::string _sessionId; + std::auto_ptr<DeploymentException> _exception; +}; + } #endif diff --git a/cpp/src/IceGrid/Topics.cpp b/cpp/src/IceGrid/Topics.cpp index df673f08813..508a07920a4 100644 --- a/cpp/src/IceGrid/Topics.cpp +++ b/cpp/src/IceGrid/Topics.cpp @@ -76,9 +76,17 @@ private: const int _serial; }; - NodeObserverTopic::NodeObserverTopic(const Ice::ObjectAdapterPtr& adapter, const IceStorm::TopicManagerPrx& topicManager) : +/* +#ifdef __BCPLUSPLUS__ // COMPILERFIX +{ +} + +void +NodeObserverTopic::initialize(const IceStorm::TopicManagerPrx& topicManager) +#endif +*/ _serial(0) { IceStorm::TopicPrx t; @@ -260,6 +268,15 @@ NodeObserverTopic::unsubscribe(const NodeObserverPrx& observer) RegistryObserverTopic::RegistryObserverTopic(const Ice::ObjectAdapterPtr& adapter, const IceStorm::TopicManagerPrx& topicManager) : +/* +#ifdef __BCPLUSPLUS__ // COMPILERFIX +{ +} + +void +RegistryObserverTopic::initialize(const IceStorm::TopicManagerPrx& topicManager) +#endif +*/ _serial(0) { IceStorm::TopicPrx t; diff --git a/cpp/src/IceGrid/Topics.h b/cpp/src/IceGrid/Topics.h index 90924b4fea7..b51985e0535 100644 --- a/cpp/src/IceGrid/Topics.h +++ b/cpp/src/IceGrid/Topics.h @@ -24,6 +24,9 @@ class NodeObserverTopic : public NodeObserver, public IceUtil::Mutex public: NodeObserverTopic(const Ice::ObjectAdapterPtr&, const IceStorm::TopicManagerPrx&); +#ifdef __BCPLUSPLUS__ // COMPILERFIX +// void initialize(const IceStorm::TopicManagerPrx&); +#endif virtual void init(const NodeDynamicInfoSeq&, const Ice::Current&); virtual void nodeUp(const NodeDynamicInfo&, const Ice::Current&); @@ -51,11 +54,14 @@ typedef IceUtil::Handle<NodeObserverTopic> NodeObserverTopicPtr; class RegistryObserverTopic : public RegistryObserver, public IceUtil::Monitor<IceUtil::Mutex> { public: +#ifdef __BCPLUSPLUS__ // COMPILERFIX +// void initialize(const IceStorm::TopicManagerPrx&); +#endif + RegistryObserverTopic(const Ice::ObjectAdapterPtr&, const IceStorm::TopicManagerPrx&); virtual void init(int, const ApplicationInfoSeq&, const AdapterInfoSeq&, const ObjectInfoSeq&, const Ice::Current&); - virtual void applicationAdded(int, const ApplicationInfo&, const Ice::Current&); virtual void applicationRemoved(int, const std::string&, const Ice::Current&); virtual void applicationUpdated(int, const ApplicationUpdateInfo&, const Ice::Current&); diff --git a/cpp/src/IceGrid/Util.h b/cpp/src/IceGrid/Util.h index c7f6ed142a3..f48c9ede590 100644 --- a/cpp/src/IceGrid/Util.h +++ b/cpp/src/IceGrid/Util.h @@ -16,6 +16,9 @@ #include <IceUtil/Random.h> #include <functional> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif namespace IceGrid { diff --git a/cpp/src/IcePatch2/Calc.cpp b/cpp/src/IcePatch2/Calc.cpp index 42386286936..dfe342c7018 100644 --- a/cpp/src/IcePatch2/Calc.cpp +++ b/cpp/src/IcePatch2/Calc.cpp @@ -12,6 +12,10 @@ #include <IcePatch2/Util.h> #include <OS.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif + using namespace std; using namespace Ice; using namespace IcePatch2; @@ -128,7 +132,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/IcePatch2/Client.cpp b/cpp/src/IcePatch2/Client.cpp index 8427f0c8257..7cb8243d55d 100644 --- a/cpp/src/IcePatch2/Client.cpp +++ b/cpp/src/IcePatch2/Client.cpp @@ -169,7 +169,11 @@ private: keyPressed() { bool pressed = false; +#ifdef __BCPLUSPLUS__ + while(kbhit()) +#else while(_kbhit()) +#endif { pressed = true; _getch(); @@ -241,7 +245,7 @@ Client::run(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/IcePatch2/ClientUtil.cpp b/cpp/src/IcePatch2/ClientUtil.cpp index 0cd356e93df..2c6f736f436 100755 --- a/cpp/src/IcePatch2/ClientUtil.cpp +++ b/cpp/src/IcePatch2/ClientUtil.cpp @@ -14,6 +14,10 @@ #include <list> #include <OS.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif + using namespace std; using namespace Ice; using namespace IcePatch2; diff --git a/cpp/src/IcePatch2/Makefile.mak b/cpp/src/IcePatch2/Makefile.mak new file mode 100644 index 00000000000..4e015b27cc9 --- /dev/null +++ b/cpp/src/IcePatch2/Makefile.mak @@ -0,0 +1,113 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\icepatch2$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\icepatch2$(SOVERSION)$(LIBSUFFIX).dll + +SERVER = $(top_srcdir)\bin\icepatch2server.exe +CLIENT = $(top_srcdir)\bin\icepatch2client.exe +CALC = $(top_srcdir)\bin\icepatch2calc.exe + +!ifdef BUILD_UTILS + +TARGETS = $(SERVER) $(CLIENT) $(CALC) + +!else + +TARGETS = $(LIBNAME) $(DLLNAME) + +!endif + +OBJS = Util.o \ + ClientUtil.o \ + FileInfo.o \ + FileServer.o \ + OS.o + +SOBJS = Server.o \ + FileServerI.o + +COBJS = Client.o + +CALCOBJS = Calc.o + +SRCS = $(OBJS:.o=.cpp) \ + $(SOBJS:.o=.cpp) \ + $(COBJS:.o=.cpp) \ + $(CALCOBJS:.o=.cpp) + +HDIR = $(includedir)\IcePatch2 +SDIR = $(slicedir)\IcePatch2 + +!include $(top_srcdir)\config\Make.rules.mak + +!ifdef BUILD_UTILS + +CPPFLAGS = -I. -I.. $(CPPFLAGS) + +!else + +CPPFLAGS = -I. -I.. $(CPPFLAGS) -DICE_PATCH2_API_EXPORTS + +!endif + +SLICE2CPPFLAGS = --ice --include-dir IcePatch2 --dll-export ICE_PATCH2_API $(SLICE2CPPFLAGS) + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LIBS) $(BZIP2_LIBS) $(OPENSSL_LIBS) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +$(SERVER): $(SOBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(SOBJS), $@,, $(LIBS) icepatch2$(LIBSUFFIX).lib + +$(CLIENT): $(COBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(COBJS), $@,, $(LIBS) icepatch2$(LIBSUFFIX).lib + +$(CALC): $(CALCOBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(CALCOBJS), $@,, $(LIBS) icepatch2$(LIBSUFFIX).lib + +FileInfo.cpp $(HDIR)\FileInfo.h: $(SDIR)\FileInfo.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\FileInfo.ice + move FileInfo.h $(HDIR) + +FileServer.cpp $(HDIR)\FileServer.h: $(SDIR)\FileServer.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) $(SDIR)\FileServer.ice + move FileServer.h $(HDIR) + +!ifdef BUILD_UTILS + +clean:: + del /q FileInfo.cpp $(HDIR)\FileInfo.h + del /q FileServer.cpp $(HDIR)\FileServer.h + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + copy $(SERVER) $(install_bindir) + copy $(CLIENT) $(install_bindir) + copy $(CALC) $(install_bindir) + +!else + +install:: all + +$(EVERYTHING):: + $(MAKE) /f Makefile.mak BUILD_UTILS=1 $@ + +!endif + +!include .depend diff --git a/cpp/src/IcePatch2/OS.cpp b/cpp/src/IcePatch2/OS.cpp index eadaf3d16ac..df7654cb712 100644 --- a/cpp/src/IcePatch2/OS.cpp +++ b/cpp/src/IcePatch2/OS.cpp @@ -11,6 +11,11 @@ #include <OS.h> #include <IceUtil/Unicode.h> +#ifdef __BCPLUSPLUS__ +# include <dir.h> +# include <io.h> +#endif + using namespace std; using namespace OS; diff --git a/cpp/src/IcePatch2/OS.h b/cpp/src/IcePatch2/OS.h index 3957c7c2813..9e86493d1aa 100644 --- a/cpp/src/IcePatch2/OS.h +++ b/cpp/src/IcePatch2/OS.h @@ -13,6 +13,7 @@ #include <Ice/Config.h> #include <sys/stat.h> #include <fcntl.h> +#include <stdio.h> #ifndef ICE_PATCH2_API # ifdef ICE_PATCH2_API_EXPORTS @@ -28,11 +29,13 @@ namespace OS #ifdef _WIN32 typedef struct _stat structstat; +#ifdef _MSC_VER # define O_RDONLY _O_RDONLY # define O_BINARY _O_BINARY # define S_ISDIR(mode) ((mode) & _S_IFDIR) # define S_ISREG(mode) ((mode) & _S_IFREG) +#endif #else diff --git a/cpp/src/IcePatch2/Server.cpp b/cpp/src/IcePatch2/Server.cpp index efe193805cf..7c604c1a392 100644 --- a/cpp/src/IcePatch2/Server.cpp +++ b/cpp/src/IcePatch2/Server.cpp @@ -74,7 +74,7 @@ IcePatch2::PatcherService::start(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/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp index d8522353f21..652e088efd0 100644 --- a/cpp/src/IcePatch2/Util.cpp +++ b/cpp/src/IcePatch2/Util.cpp @@ -30,6 +30,10 @@ # include <dirent.h> #endif +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif + const char* IcePatch2::checksumFile = "IcePatch2.sum"; const char* IcePatch2::logFile = "IcePatch2.log"; @@ -426,6 +430,7 @@ IcePatch2::getDirname(const string& pa) void IcePatch2::rename(const string& fromPa, const string& toPa) { + const string fromPath = simplify(fromPa); const string toPath = simplify(toPa); @@ -452,6 +457,10 @@ IcePatch2::remove(const string& pa) { if(OS::rmdir(path) == -1) { + if(errno == EACCES) + { + assert(false); + } throw "cannot remove directory `" + path + "':\n" + lastError(); } } @@ -507,24 +516,25 @@ IcePatch2::readDirectory(const string& pa) #ifdef _WIN32 - struct _wfinddata_t data; + StringSeq result; const wstring fs = IceUtil::stringToWstring(simplify(path + "/*")); -#if defined(_MSC_VER) && (_MSC_VER < 1300) - long h = _wfindfirst(fs.c_str(), &data); -#else - intptr_t h = _wfindfirst(fs.c_str(), &data); -#endif +# ifdef __BCPLUSPLUS__ + struct _wffblk data; + int h = _wfindfirst(fs.c_str(), &data, FA_DIREC); if(h == -1) { + if(_doserrno == ENMFILE) + { + return result; + } throw "cannot read directory `" + path + "':\n" + lastError(); } - StringSeq result; while(true) { - string name = IceUtil::wstringToString(data.name); + string name = IceUtil::wstringToString(data.ff_name); assert(!name.empty()); if(name != ".." && name != ".") @@ -532,7 +542,7 @@ IcePatch2::readDirectory(const string& pa) result.push_back(name); } - if(_wfindnext(h, &data) == -1) + if(_wfindnext(&data) == -1) { if(errno == ENOENT) { @@ -540,15 +550,52 @@ IcePatch2::readDirectory(const string& pa) } string ex = "cannot read directory `" + path + "':\n" + lastError(); - _findclose(h); + _wfindclose(&data); throw ex; } } + _wfindclose(&data); +# else + struct _wfinddata_t data; + +# if defined(_MSC_VER) && (_MSC_VER < 1300) + long h = _wfindfirst(fs.c_str(), &data); +# else + intptr_t h = _wfindfirst(fs.c_str(), &data); +# endif + if(h == -1) + { + throw "cannot read directory `" + path + "':\n" + lastError(); + } + + while(true) + { + string name = IceUtil::wstringToString(data.name); + assert(!name.empty()); + + if(name != ".." && name != ".") + { + result.push_back(name); + } + + if(_wfindnext(h, &data) == -1) + { + if(errno == ENOENT) + { + break; + } + + string ex = "cannot read directory `" + path + "':\n" + lastError(); + _findclose(h); + throw ex; + } + } + _findclose(h); +# endif sort(result.begin(), result.end()); - return result; #else diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp index 030f798042a..05d4055edd0 100755 --- a/cpp/src/IceSSL/Certificate.cpp +++ b/cpp/src/IceSSL/Certificate.cpp @@ -122,7 +122,7 @@ ASMUtcTimeToIceUtilTime(const ASN1_UTCTIME* s) } static string -convertX509NameToString(X509_NAME* name) +convertX509NameToString(X509NAME* name) { BIO* out = BIO_new(BIO_s_mem()); X509_NAME_print_ex(out, name, 0, XN_FLAG_RFC2253); @@ -245,7 +245,7 @@ ParseException::ice_throw() const throw *this; } -DistinguishedName::DistinguishedName(X509_NAME* name) : +DistinguishedName::DistinguishedName(X509NAME* name) : _rdns(RFC2253::parseStrict(convertX509NameToString(name))) { unescape(); diff --git a/cpp/src/IceSSL/Makefile.mak b/cpp/src/IceSSL/Makefile.mak new file mode 100644 index 00000000000..f692eed1e59 --- /dev/null +++ b/cpp/src/IceSSL/Makefile.mak @@ -0,0 +1,49 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\icessl$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\icessl$(SOVERSION)$(LIBSUFFIX).dll + +TARGETS = $(LIBNAME) $(DLLNAME) + +OBJS = AcceptorI.o \ + Certificate.o \ + ConnectorI.o \ + EndpointI.o \ + Instance.o \ + PluginI.o \ + TransceiverI.o \ + Util.o \ + RFC2253.o \ + TrustManager.o + +SRCS = $(OBJS:.o=.cpp) + +HDIR = $(includedir)\IceSSL + +!include $(top_srcdir)/config/Make.rules.mak + +CPPFLAGS = -I.. $(CPPFLAGS) -DICE_SSL_API_EXPORTS + +LINKWITH = $(OPENSSL_LIBS) $(LIBS) + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LINKWITH) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + +!include .depend diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp index 2298170812c..81da0f00efb 100644 --- a/cpp/src/IceSSL/Util.cpp +++ b/cpp/src/IceSSL/Util.cpp @@ -15,8 +15,10 @@ # include <direct.h> # include <sys/types.h> # include <sys/stat.h> -# define S_ISDIR(mode) ((mode) & _S_IFDIR) -# define S_ISREG(mode) ((mode) & _S_IFREG) +# ifdef _MSC_VER +# define S_ISDIR(mode) ((mode) & _S_IFDIR) +# define S_ISREG(mode) ((mode) & _S_IFREG) +# endif #else # include <sys/stat.h> #endif diff --git a/cpp/src/IceStorm/Admin.cpp b/cpp/src/IceStorm/Admin.cpp index 296aa2029cf..aa94afbb525 100644 --- a/cpp/src/IceStorm/Admin.cpp +++ b/cpp/src/IceStorm/Admin.cpp @@ -71,7 +71,7 @@ Client::run(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/IceStorm/Flusher.cpp b/cpp/src/IceStorm/Flusher.cpp index 097de86d24d..0c9142db350 100644 --- a/cpp/src/IceStorm/Flusher.cpp +++ b/cpp/src/IceStorm/Flusher.cpp @@ -14,146 +14,125 @@ #include <IceStorm/TraceLevels.h> #include <IceStorm/Flusher.h> #include <algorithm> -#include <list> using namespace IceStorm; using namespace std; -namespace IceStorm +FlusherThread::FlusherThread(const Ice::CommunicatorPtr& communicator, const TraceLevelsPtr& traceLevels) : + _communicator(communicator), + _traceLevels(traceLevels), + _destroy(false) { - -typedef std::list<FlushablePtr> FlushableList; - -class FlusherThread : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex> -{ -public: - - FlusherThread(const Ice::CommunicatorPtr& communicator, const TraceLevelsPtr& traceLevels) : - _communicator(communicator), - _traceLevels(traceLevels), - _destroy(false) + _flushTime = communicator->getProperties()->getPropertyAsIntWithDefault("IceStorm.Flush.Timeout", 1000); + if(_flushTime < 100) { - _flushTime = communicator->getProperties()->getPropertyAsIntWithDefault("IceStorm.Flush.Timeout", 1000); - if(_flushTime < 100) - { - _flushTime = 100; // Minimum of 100 ms - } + _flushTime = 100; // Minimum of 100 ms } +} - ~FlusherThread() - { - } +FlusherThread::~FlusherThread() +{ +} - virtual void - run() +void +FlusherThread::run() +{ + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_destroy) { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_destroy) - { - long tout = calcTimeout(); - if(tout == 0) - { - wait(); - } - else - { - timedWait(IceUtil::Time::milliSeconds(tout)); - } - if(_destroy) - { - continue; - } - flushAll(); - } - - // - // We break a cycle by clearing the subscriber list. - // - _subscribers.clear(); + long tout = calcTimeout(); + if(tout == 0) + { + wait(); + } + else + { + timedWait(IceUtil::Time::milliSeconds(tout)); + } + if(_destroy) + { + continue; + } + flushAll(); } - void - destroy() - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - _destroy = true; - notify(); - } + // + // We break a cycle by clearing the subscriber list. + // + _subscribers.clear(); +} + +void +FlusherThread::destroy() +{ + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + _destroy = true; + notify(); +} + +// +// It would be possible to write add/remove in such a way as to +// avoid blocking while flushing by having a queue of actions +// which are only performed before flushing. For now, however, +// this issue is ignored. +// +void +FlusherThread::add(const FlushablePtr& subscriber) +{ + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + bool isEmpty = _subscribers.empty(); + _subscribers.push_back(subscriber); // - // It would be possible to write add/remove in such a way as to - // avoid blocking while flushing by having a queue of actions - // which are only performed before flushing. For now, however, - // this issue is ignored. + // If the set of subscribers was previously empty then wake up + // the flushing thread since it will be waiting indefinitely // - void - add(const FlushablePtr& subscriber) + if(isEmpty) { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - bool isEmpty = _subscribers.empty(); - _subscribers.push_back(subscriber); - - // - // If the set of subscribers was previously empty then wake up - // the flushing thread since it will be waiting indefinitely - // - if(isEmpty) - { - notify(); - } + notify(); } +} - void - remove(const FlushablePtr& subscriber) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - _subscribers.remove(subscriber); - } +void +FlusherThread::remove(const FlushablePtr& subscriber) +{ + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + _subscribers.remove(subscriber); +} -private: +void +FlusherThread::flushAll() +{ + // This is always called with the monitor locked + //IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - void - flushAll() - { - // This is always called with the monitor locked - //IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // remove_if doesn't work with handle types. remove_if also - // isn't present in the STLport implementation - // - // _subscribers.remove_if(IceUtil::constMemFun(&Flushable::inactive)); - // - _subscribers.erase(remove_if(_subscribers.begin(), _subscribers.end(), - IceUtil::constMemFun(&Flushable::inactive)), _subscribers.end()); - - _communicator->flushBatchRequests(); - - // - // Trace after the flush so that the correct number of objects - // are displayed - // - if(_traceLevels->flush > 0) - { - Ice::Trace out(_traceLevels->logger, _traceLevels->flushCat); - out << _subscribers.size() << " object(s)"; - } - } - long - calcTimeout() + // remove_if doesn't work with handle types. remove_if also + // isn't present in the STLport implementation + // + // _subscribers.remove_if(IceUtil::constMemFun(&Flushable::inactive)); + // + _subscribers.erase(remove_if(_subscribers.begin(), _subscribers.end(), + IceUtil::constMemFun(&Flushable::inactive)), _subscribers.end()); + + _communicator->flushBatchRequests(); + + // + // Trace after the flush so that the correct number of objects + // are displayed + // + if(_traceLevels->flush > 0) { - return (_subscribers.empty()) ? 0 : _flushTime; + Ice::Trace out(_traceLevels->logger, _traceLevels->flushCat); + out << _subscribers.size() << " object(s)"; } +} - Ice::CommunicatorPtr _communicator; - TraceLevelsPtr _traceLevels; - FlushableList _subscribers; - bool _destroy; - long _flushTime; -}; - -} // End namespace IceStorm +long +FlusherThread::calcTimeout() +{ + return (_subscribers.empty()) ? 0 : _flushTime; +} Flusher::Flusher(const Ice::CommunicatorPtr& communicator, const TraceLevelsPtr& traceLevels) { diff --git a/cpp/src/IceStorm/Flusher.h b/cpp/src/IceStorm/Flusher.h index a5ce6dd7c2f..33d305884f5 100644 --- a/cpp/src/IceStorm/Flusher.h +++ b/cpp/src/IceStorm/Flusher.h @@ -12,7 +12,9 @@ #include <IceUtil/Handle.h> #include <IceUtil/Shared.h> +#include <IceUtil/Thread.h> #include <Ice/CommunicatorF.h> +#include <list> namespace IceStorm { @@ -20,14 +22,40 @@ namespace IceStorm // // Forward declarations. // -class FlusherThread; -typedef IceUtil::Handle<FlusherThread> FlusherThreadPtr; - class TraceLevels; typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; class Flushable; typedef IceUtil::Handle<Flushable> FlushablePtr; +typedef std::list<FlushablePtr> FlushableList; + +// +// Flusher Thread +// +class FlusherThread : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex> +{ +public: + + FlusherThread(const Ice::CommunicatorPtr&, const TraceLevelsPtr&); + ~FlusherThread(); + + virtual void run(); + void destroy(); + void add(const FlushablePtr&); + void remove(const FlushablePtr&); +private: + + void flushAll(); + long calcTimeout(); + + Ice::CommunicatorPtr _communicator; + TraceLevelsPtr _traceLevels; + FlushableList _subscribers; + bool _destroy; + long _flushTime; +}; + +typedef IceUtil::Handle<FlusherThread> FlusherThreadPtr; // // Responsible for flushing Flushable objects at regular intervals. diff --git a/cpp/src/IceStorm/Makefile b/cpp/src/IceStorm/Makefile index 176b62bb68d..48fb09e3941 100644 --- a/cpp/src/IceStorm/Makefile +++ b/cpp/src/IceStorm/Makefile @@ -52,7 +52,6 @@ AOBJS = Admin.o \ SRCS = $(OBJS:.o=.cpp) \ $(SERVICE_OBJS:.o=.cpp) \ - $(SERVER_OBJS:.o=.cpp) \ $(AOBJS:.o=.cpp) SLICE_SRCS = $(SDIR)/IceStorm.ice \ diff --git a/cpp/src/IceStorm/Makefile.mak b/cpp/src/IceStorm/Makefile.mak new file mode 100644 index 00000000000..827b7547212 --- /dev/null +++ b/cpp/src/IceStorm/Makefile.mak @@ -0,0 +1,160 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\icestorm$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\icestorm$(SOVERSION)$(LIBSUFFIX).dll + +SVCLIBNAME = $(top_srcdir)\lib\icestormservice$(LIBSUFFIX).lib +SVCDLLNAME = $(top_srcdir)\bin\icestormservice$(SOVERSION)$(LIBSUFFIX).dll + +ADMIN = $(top_srcdir)\bin\icestormadmin.exe + +!ifdef BUILD_UTILS + +TARGETS = $(ADMIN) + +!else + +TARGETS = $(LIBNAME) $(DLLNAME) $(SVCLIBNAME) $(SVCDLLNAME) + +!endif + +OBJS = IceStorm.o \ + +SOBJS = TraceLevels.o \ + Flusher.o \ + Subscriber.o \ + OnewaySubscriber.o \ + OnewayBatchSubscriber.o \ + LinkSubscriber.o \ + SubscriberFactory.o \ + TopicI.o \ + TopicManagerI.o \ + PersistentTopicMap.o \ + LinkRecord.o \ + IceStormInternal.o \ + Service.o \ + QueuedProxy.o \ + OnewayProxy.o \ + TwowayProxy.o \ + LinkProxy.o + +AOBJS = Admin.o \ + Grammar.o \ + Scanner.o \ + WeightedGraph.o \ + Parser.o + +SRCS = $(OBJS:.o=.cpp) \ + $(SOBJS:.o=.cpp) \ + $(AOBJS:.o=.cpp) + +HDIR = $(includedir)\IceStorm +SDIR = $(slicedir)\IceStorm + +!include $(top_srcdir)\config\Make.rules.mak + +CPPFLAGS = -I.. $(CPPFLAGS) +SLICE2CPPFLAGS = --ice --include-dir IceStorm $(SLICE2CPPFLAGS) +LINKWITH = $(LIBS) icestorm$(LIBSUFFIX).lib freeze$(LIBSUFFIX).lib icebox$(LIBSUFFIX).lib +ALINKWITH = $(LIBS) icestorm$(LIBSUFFIX).lib icexml$(LIBSUFFIX).lib + +!ifndef BUILD_UTILS + +EXTRAFLAGS = -DICE_STORM_SERVICE_API_EXPORTS + +!endif + +IceStorm.o: IceStorm.cpp + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -DICE_STORM_API_EXPORTS -o IceStorm.o IceStorm.cpp + +.cpp.o: + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(EXTRAFLAGS) -o $@ $< + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LIBS) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +$(SVCLIBNAME): $(SVCDLLNAME) + +$(SVCDLLNAME): $(SOBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(SOBJS), $(SVCDLLNAME),, $(LINKWITH) + move $(SVCDLLNAME:.dll=.lib) $(SVCLIBNAME) + +$(ADMIN): $(AOBJS) + del /q $@ + $(LINK) $(LD_EXEFLAGS) $(AOBJS), $@,, $(ALINKWITH) + +PersistentTopicMap.h PersistentTopicMap.cpp: ../IceStorm/LinkRecord.ice $(slicedir)/Ice/Identity.ice $(SLICE2FREEZE) + del /q PersistentTopicMap.h PersistentTopicMap.cpp + $(SLICE2FREEZE) --ice --include-dir IceStorm -I.. -I$(slicedir) --dict \ + IceStorm::PersistentTopicMap,string,IceStorm::LinkRecordDict PersistentTopicMap \ + ..\IceStorm\LinkRecord.ice + +IceStorm.cpp $(HDIR)\IceStorm.h: $(SDIR)\IceStorm.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) --checksum --dll-export ICE_STORM_API $(SLICE2CPPFLAGS) $(SDIR)\IceStorm.ice + move IceStorm.h $(HDIR) + +IceStormInternal.cpp IceStormInternal.h: IceStormInternal.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) $(SLICE2CPPFLAGS) IceStormInternal.ice + +LinkRecord.cpp LinkRecord.h: LinkRecord.ice $(SLICE2CPP) $(SLICEPARSERLIB) + $(SLICE2CPP) -I.. $(SLICE2CPPFLAGS) LinkRecord.ice + +Scanner.cpp : Scanner.l + flex $(FLEXFLAGS) Scanner.l + del /q $@ + echo #include "IceUtil/Config.h" > Scanner.cpp + type lex.yy.c >> Scanner.cpp + del /q lex.yy.c + +Grammar.cpp Grammar.h: Grammar.y + del /q Grammar.h Grammar.cpp + bison -dvt Grammar.y + move Grammar.tab.c Grammar.cpp + move Grammar.tab.h Grammar.h + del /q Grammar.output + +!ifdef BUILD_UTILS + +clean:: + del /q PersistentTopicMap.h PersistentTopicMap.cpp + +clean:: + del /q IceStorm.cpp $(HDIR)\IceStorm.h + del /q IceStormInternal.cpp IceStormInternal.h + del /q LinkRecord.cpp LinkRecord.h + +clean:: + del /q Grammar.cpp Grammar.h + del /q Scanner.cpp + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + copy $(SVCLIBNAME) $(install_libdir) + copy $(SVCDLLNAME) $(install_bindir) + copy $(ADMIN) $(install_bindir) + +!else + +install:: all + +$(EVERYTHING):: + $(MAKE) /f Makefile.mak BUILD_UTILS=1 $@ + +!endif + +!include .depend diff --git a/cpp/src/IceStorm/OnewaySubscriber.h b/cpp/src/IceStorm/OnewaySubscriber.h index 6480f89c883..e9ede06c451 100644 --- a/cpp/src/IceStorm/OnewaySubscriber.h +++ b/cpp/src/IceStorm/OnewaySubscriber.h @@ -12,13 +12,11 @@ #include <IceStorm/Subscriber.h> #include <IceStorm/QueuedProxy.h> +#include <IceStorm/SubscriberFactory.h> namespace IceStorm { -class SubscriberFactory; -typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr; - class OnewaySubscriber : public Subscriber { public: diff --git a/cpp/src/IceStorm/Parser.h b/cpp/src/IceStorm/Parser.h index 222ab0145b8..7025ba30127 100644 --- a/cpp/src/IceStorm/Parser.h +++ b/cpp/src/IceStorm/Parser.h @@ -13,13 +13,14 @@ #include <IceUtil/Handle.h> #include <IceStorm/IceStorm.h> #include <list> +#include <stdio.h> #ifdef _WIN32 # include <io.h> -# define isatty _isatty -# define fileno _fileno -// '_isatty' : inconsistent dll linkage. dllexport assumed. # ifdef _MSC_VER +# define isatty _isatty +# define fileno _fileno +// '_isatty' : inconsistent dll linkage. dllexport assumed. # pragma warning( disable : 4273 ) # endif #endif diff --git a/cpp/src/IceStorm/Scanner.l b/cpp/src/IceStorm/Scanner.l index 8065c2553c0..4edfa55ee23 100644 --- a/cpp/src/IceStorm/Scanner.l +++ b/cpp/src/IceStorm/Scanner.l @@ -33,6 +33,7 @@ WS [ \t\v\f\r] NL [\n] %option noyywrap +%option never-interactive %% diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp index 6d5291b0565..99210191015 100644 --- a/cpp/src/IceStorm/Service.cpp +++ b/cpp/src/IceStorm/Service.cpp @@ -7,6 +7,9 @@ // // ********************************************************************** +#include <IceStorm/SubscriberFactory.h> +#include <IceStorm/Flusher.h> +#include <IceStorm/TopicI.h> #include <IceStorm/TopicManagerI.h> #include <IceStorm/TraceLevels.h> #include <IceStorm/Service.h> diff --git a/cpp/src/IceUtil/Base64.cpp b/cpp/src/IceUtil/Base64.cpp index 2c75508a431..0c328e04a1e 100644 --- a/cpp/src/IceUtil/Base64.cpp +++ b/cpp/src/IceUtil/Base64.cpp @@ -9,6 +9,9 @@ #include <IceUtil/Base64.h> #include <iostream> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif using namespace std; diff --git a/cpp/src/IceUtil/InputUtil.cpp b/cpp/src/IceUtil/InputUtil.cpp index 527f23e166a..620fa5fe68a 100644 --- a/cpp/src/IceUtil/InputUtil.cpp +++ b/cpp/src/IceUtil/InputUtil.cpp @@ -24,7 +24,7 @@ using namespace std; namespace IceUtil { -#if defined(_MSC_VER) && (_MSC_VER < 1300) +#if defined(__BCPLUSPLUS__) || (defined(_MSC_VER) && (_MSC_VER < 1300)) // // The VC60 runtime does not include _strtoi64, so we provide our own implementation // @@ -176,7 +176,7 @@ Int64 strToInt64(const char* s, char** endptr, int base) { #if defined(_WIN32) -# if defined(_MSC_VER) && (_MSC_VER < 1300) +# if defined(__BCPLUSPLUS__) || (defined(_MSC_VER) && (_MSC_VER < 1300)) return strToInt64Impl(s, endptr, base); # else return _strtoi64(s, endptr, base); diff --git a/cpp/src/IceUtil/Makefile.mak b/cpp/src/IceUtil/Makefile.mak new file mode 100644 index 00000000000..99f3ec1e0a3 --- /dev/null +++ b/cpp/src/IceUtil/Makefile.mak @@ -0,0 +1,64 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\iceutil$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\iceutil$(SOVERSION)$(LIBSUFFIX).dll + +TARGETS = $(LIBNAME) $(DLLNAME) + +OBJS = Base64.o \ + Cond.o \ + ConvertUTF.o \ + CountDownLatch.o \ + CtrlCHandler.o \ + Exception.o \ + Shared.o \ + InputUtil.o \ + MD5.o \ + MD5I.o \ + Options.o \ + OutputUtil.o \ + Random.o \ + RWRecMutex.o \ + RecMutex.o \ + StaticMutex.o \ + StringUtil.o \ + Thread.o \ + ThreadException.o \ + Time.o \ + UUID.o \ + Unicode.o + +SRCS = $(OBJS:.o=.cpp) + +!include $(top_srcdir)/config/Make.rules.mak + +CPPFLAGS = $(CPPFLAGS) -DICE_UTIL_API_EXPORTS -I.. +LINKWITH = $(STLPORT_LIBS) $(ICEUTIL_OS_LIBS) + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LINKWITH) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + +!include .depend + +parser: parser.o + del /q $@ + $(CXX) $(LDFLAGS) -o $@ parser.o $(BASELIBS) + diff --git a/cpp/src/IceUtil/Options.cpp b/cpp/src/IceUtil/Options.cpp index f921cc76890..ccbf4b462e3 100755 --- a/cpp/src/IceUtil/Options.cpp +++ b/cpp/src/IceUtil/Options.cpp @@ -691,7 +691,11 @@ IceUtil::Options::optArg(const string& opt) const } map<string, string>::const_iterator p = _opts.find(opt); - return p == _opts.end() ? "" : p->second; + if(p == _opts.end()) + { + return ""; + } + return p->second; } vector<string> diff --git a/cpp/src/IceUtil/Random.cpp b/cpp/src/IceUtil/Random.cpp index 3daec473553..9713b990932 100644 --- a/cpp/src/IceUtil/Random.cpp +++ b/cpp/src/IceUtil/Random.cpp @@ -19,7 +19,6 @@ using namespace std; - IceUtil::RandomGeneratorException::RandomGeneratorException(const char* file, int line, int error) : Exception(file, line), _error(error) diff --git a/cpp/src/IceUtil/Time.cpp b/cpp/src/IceUtil/Time.cpp index e7b572baed6..6f0ba3d1273 100644 --- a/cpp/src/IceUtil/Time.cpp +++ b/cpp/src/IceUtil/Time.cpp @@ -29,8 +29,13 @@ Time IceUtil::Time::now() { #ifdef _WIN32 +# if defined(_MSC_VER) struct _timeb tb; _ftime(&tb); +# elif defined(__BCPLUSPLUS__) + struct timeb tb; + ftime(&tb); +# endif return Time(static_cast<Int64>(tb.time) * ICE_INT64(1000000) + tb.millitm * 1000); #else diff --git a/cpp/src/IceXML/Makefile.mak b/cpp/src/IceXML/Makefile.mak new file mode 100644 index 00000000000..43af1bf3ab8 --- /dev/null +++ b/cpp/src/IceXML/Makefile.mak @@ -0,0 +1,38 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\icexml$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\icexml$(SOVERSION)$(LIBSUFFIX).dll + +TARGETS = $(LIBNAME) $(DLLNAME) + +OBJS = Parser.o + +SRCS = $(OBJS:.o=.cpp) + +!include $(top_srcdir)/config/Make.rules.mak + +CPPFLAGS = $(CPPFLAGS) -DICE_XML_API_EXPORTS + +LINKWITH = $(EXPAT_LIBS) $(BASELIBS) + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(LINKWITH) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + +!include .depend diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp index 086e3475a0b..71db1bad4ee 100644 --- a/cpp/src/IceXML/Parser.cpp +++ b/cpp/src/IceXML/Parser.cpp @@ -39,7 +39,11 @@ IceXML::ParserException::ice_name() const void IceXML::ParserException::ice_print(std::ostream& out) const { +#ifdef __BCPLUSPLUS__ + IceUtil::Exception::ice_print(out); +#else Exception::ice_print(out); +#endif if(!_reason.empty()) { out << "\n" << _reason; @@ -265,7 +269,7 @@ IceXML::DocumentBuilder::startElement(const string& name, const Attributes& attr NodePtr parent = _nodeStack.front(); Element* element = new Element(parent, name, attributes, line, column); -#if NDEBUG +#ifdef NDEBUG parent->addChild(element); #else assert(parent->addChild(element)); diff --git a/cpp/src/Makefile.mak b/cpp/src/Makefile.mak new file mode 100644 index 00000000000..89d11364a1c --- /dev/null +++ b/cpp/src/Makefile.mak @@ -0,0 +1,41 @@ +# ********************************************************************** +# +# 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 = .. + +!include $(top_srcdir)/config/Make.rules.mak + +SUBDIRS = IceUtil \ + Slice \ + slice2cpp \ + slice2cs \ + slice2vb \ + slice2freeze \ + slice2freezej \ + slice2docbook \ + slice2java \ + slice2py \ + slice2cppe \ + slice2javae \ + Ice \ + IceXML \ + IceSSL \ + IceBox \ + IcePatch2 \ + Glacier2 \ + Freeze \ + FreezeScript \ + IceStorm \ + IceGrid \ + ca + +$(EVERYTHING):: + @for %i in ( $(SUBDIRS) ) do \ + @echo "making $@ in %i" & \ + cmd /c "cd %i & $(MAKE) -f Makefile.mak $@" diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index 40bc0a5e705..6322c18219c 100755 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -498,17 +498,17 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, if(sz <= 0x7f) { func = marshal ? "writeByte" : "readByte"; - cast = marshal ? "(byte)" : "(" + fixId(en->scoped()) + ")"; + cast = marshal ? string("(byte)") : "(" + fixId(en->scoped()) + ")"; } else if(sz <= 0x7fff) { func = marshal ? "writeShort" : "readShort"; - cast = marshal ? "(short)" : "(" + fixId(en->scoped()) + ")"; + cast = marshal ? string("(short)") : "(" + fixId(en->scoped()) + ")"; } else { func = marshal ? "writeInt" : "readInt"; - cast = marshal ? "(int)" : "(" + fixId(en->scoped()) + ")"; + cast = marshal ? string("(int)") : "(" + fixId(en->scoped()) + ")"; } if(marshal) { diff --git a/cpp/src/Slice/Makefile.mak b/cpp/src/Slice/Makefile.mak new file mode 100644 index 00000000000..9847338b451 --- /dev/null +++ b/cpp/src/Slice/Makefile.mak @@ -0,0 +1,64 @@ +# ********************************************************************** +# +# 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 = ..\.. + +LIBNAME = $(top_srcdir)\lib\slice$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\slice$(SOVERSION)$(LIBSUFFIX).dll + +TARGETS = $(LIBNAME) $(DLLNAME) + +OBJS = Scanner.o \ + Grammar.o \ + Parser.o \ + CPlusPlusUtil.o \ + CsUtil.o \ + VbUtil.o \ + JavaUtil.o \ + Preprocessor.o \ + Checksum.o \ + PythonUtil.o \ + DotNetNames.o + +SRCS = $(OBJS:.o=.cpp) + +!include $(top_srcdir)/config/Make.rules.mak + +CPPFLAGS = -I.. $(CPPFLAGS) -DSLICE_API_EXPORTS + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + del /q $@ + $(LINK) $(LD_DLLFLAGS) $(OBJS), $(DLLNAME),, $(BASELIBS) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + +Scanner.cpp : Scanner.l + flex $(FLEXFLAGS) Scanner.l + del /q $@ + echo #include "IceUtil/Config.h" > Scanner.cpp + type lex.yy.c >> Scanner.cpp + del /q lex.yy.c + +Grammar.cpp Grammar.h: Grammar.y + del /q Grammar.h Grammar.cpp + bison -dvt --name-prefix "slice_" Grammar.y + move Grammar.tab.c Grammar.cpp + move Grammar.tab.h Grammar.h + del /q Grammar.output + +clean:: + del /q Grammar.cpp Grammar.h + del /q Scanner.cpp + +install:: all + copy $(LIBNAME) $(install_libdir) + copy $(DLLNAME) $(install_bindir) + +!include .depend diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 75710f0c86a..305f927d947 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -10,6 +10,9 @@ #include <IceUtil/Functional.h> #include <Slice/Parser.h> #include <Slice/GrammarUtil.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif using namespace std; using namespace Slice; diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index 34dffee22a3..a45f817878c 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -10,6 +10,9 @@ #include <Slice/PythonUtil.h> #include <Slice/Checksum.h> #include <IceUtil/Functional.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif using namespace std; using namespace Slice; diff --git a/cpp/src/Slice/VbUtil.cpp b/cpp/src/Slice/VbUtil.cpp index 1ce6aef391a..8fd115f961e 100755 --- a/cpp/src/Slice/VbUtil.cpp +++ b/cpp/src/Slice/VbUtil.cpp @@ -518,17 +518,17 @@ Slice::VbGenerator::writeMarshalUnmarshalCode(Output &out, if(sz <= 0x7f) { func = marshal ? "writeByte" : "readByte"; - cast = marshal ? "Byte" : fixId(en->scoped()); + cast = marshal ? string("Byte") : fixId(en->scoped()); } else if(sz <= 0x7fff) { func = marshal ? "writeShort" : "readShort"; - cast = marshal ? "Short" : fixId(en->scoped()); + cast = marshal ? string("Short") : fixId(en->scoped()); } else { func = marshal ? "writeInt" : "readInt"; - cast = marshal ? "Integer" : fixId(en->scoped()); + cast = marshal ? string("Integer") : fixId(en->scoped()); } if(marshal) { diff --git a/cpp/src/ca/Makefile b/cpp/src/ca/Makefile index ade4975208f..f80055cd381 100644 --- a/cpp/src/ca/Makefile +++ b/cpp/src/ca/Makefile @@ -11,7 +11,7 @@ top_srcdir = ../.. include $(top_srcdir)/config/Make.rules -CA_FILES = iceca \ +CA_FILES = iceca ImportKey.class install:: diff --git a/cpp/src/ca/Makefile.mak b/cpp/src/ca/Makefile.mak new file mode 100644 index 00000000000..382635b0697 --- /dev/null +++ b/cpp/src/ca/Makefile.mak @@ -0,0 +1,20 @@ +# ********************************************************************** +# +# 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 = ..\.. + +!include $(top_srcdir)/config/Make.rules.mak + +CA_FILES = iceca \ + ImportKey.class + +install:: + @for %i in ( $(CA_FILES) ) do \ + @echo "Installing %i" & \ + copy %i $(install_bindir) diff --git a/cpp/src/icecpp/config.h b/cpp/src/icecpp/config.h index 9f947753bcf..88246f9aecd 100644 --- a/cpp/src/icecpp/config.h +++ b/cpp/src/icecpp/config.h @@ -37,7 +37,9 @@ # pragma warning( 4 : 4267 ) # endif # endif -# define alloca _alloca +# ifdef _MSC_VER +# define alloca _alloca +# endif #endif #if defined(__linux) || defined(__FreeBSD__) || defined(__sun) || \ 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 diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp index b0c818c3975..88f02188172 100644 --- a/cpp/src/slice2cppe/Gen.cpp +++ b/cpp/src/slice2cppe/Gen.cpp @@ -1186,11 +1186,11 @@ 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(); @@ -2447,11 +2447,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(); diff --git a/cpp/src/slice2cppe/Main.cpp b/cpp/src/slice2cppe/Main.cpp index 125e72f43ab..3d0f7a69850 100644 --- a/cpp/src/slice2cppe/Main.cpp +++ b/cpp/src/slice2cppe/Main.cpp @@ -78,7 +78,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/slice2cppe/Makefile.mak b/cpp/src/slice2cppe/Makefile.mak new file mode 100644 index 00000000000..12d1fa48ff4 --- /dev/null +++ b/cpp/src/slice2cppe/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\slice2cppe.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 diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 12a6642fee5..7680bb8aecf 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -4147,7 +4147,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << retS << " ret__;"; ContainedPtr contained = ContainedPtr::dynamicCast(ret); _out << nl << "IceInternal.ParamPatcher ret___PP = new IceInternal.ParamPatcher(typeof(" - << retS << "), \"" << (contained? contained->scoped() : "::Ice::Object") << "\");"; + << retS << "), \"" << (contained? contained->scoped() : string("::Ice::Object")) << "\");"; _out << nl << "is__.readObject(ret___PP);"; } else diff --git a/cpp/src/slice2cs/Main.cpp b/cpp/src/slice2cs/Main.cpp index 4c42f058052..ec201f48641 100644 --- a/cpp/src/slice2cs/Main.cpp +++ b/cpp/src/slice2cs/Main.cpp @@ -78,7 +78,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/slice2cs/Makefile.mak b/cpp/src/slice2cs/Makefile.mak new file mode 100644 index 00000000000..bd5bb52c94b --- /dev/null +++ b/cpp/src/slice2cs/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\slice2cs.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 diff --git a/cpp/src/slice2docbook/Gen.cpp b/cpp/src/slice2docbook/Gen.cpp index 4d4a595f2a1..6d9cf83478b 100644 --- a/cpp/src/slice2docbook/Gen.cpp +++ b/cpp/src/slice2docbook/Gen.cpp @@ -11,6 +11,10 @@ #include <IceUtil/Functional.h> #include <Gen.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif + using namespace std; using namespace Slice; using namespace IceUtil; @@ -513,7 +517,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) O << nl << "<synopsis>"; printMetaData(*q); TypePtr returnType = (*q)->returnType(); - O << (returnType ? toString(returnType, p) : "<type>void</type>") << " <function>" << (*q)->name() + O << (returnType ? toString(returnType, p) : string("<type>void</type>")) << " <function>" << (*q)->name() << "</function>("; O.inc(); ParamDeclList paramList = (*q)->parameters(); diff --git a/cpp/src/slice2docbook/Main.cpp b/cpp/src/slice2docbook/Main.cpp index cbce4b99090..228ed36ff16 100644 --- a/cpp/src/slice2docbook/Main.cpp +++ b/cpp/src/slice2docbook/Main.cpp @@ -73,7 +73,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/slice2docbook/Makefile.mak b/cpp/src/slice2docbook/Makefile.mak new file mode 100644 index 00000000000..8fd8b7870aa --- /dev/null +++ b/cpp/src/slice2docbook/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\slice2docbook.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 diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp index 8c051ecdb55..12e31fd74aa 100644 --- a/cpp/src/slice2freeze/Main.cpp +++ b/cpp/src/slice2freeze/Main.cpp @@ -457,7 +457,7 @@ writeDictWithIndicesH(const string& name, const Dict& dict, << capitalizedMembers[i] << "(" << inputTypeToString(indexTypes[i].type, false, indexTypes[i].metaData) << ") const;"; - string countFunction = dict.indices[i].member.empty() ? "valueCount" + string countFunction = dict.indices[i].member.empty() ? string("valueCount") : dict.indices[i].member + "Count"; H << nl << "int " << countFunction @@ -745,7 +745,7 @@ writeDictWithIndicesC(const string& name, const string& absolute, const Dict& di << "(__index), upperBoundFor" << capitalizedMembers[i] << "(__index));"; C << eb; - string countFunction = dict.indices[i].member.empty() ? "valueCount" + string countFunction = dict.indices[i].member.empty() ? string("valueCount") : dict.indices[i].member + "Count"; C << sp << nl << "int" @@ -1213,7 +1213,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/slice2freeze/Makefile.mak b/cpp/src/slice2freeze/Makefile.mak new file mode 100644 index 00000000000..40c04e02d1f --- /dev/null +++ b/cpp/src/slice2freeze/Makefile.mak @@ -0,0 +1,31 @@ +# ********************************************************************** +# +# 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\slice2freeze.exe + +TARGETS = $(NAME) + +OBJS = 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 diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp index 7efb1e5aeb1..70d31cc442f 100644 --- a/cpp/src/slice2freezej/Main.cpp +++ b/cpp/src/slice2freezej/Main.cpp @@ -11,6 +11,10 @@ #include <Slice/Preprocessor.h> #include <Slice/JavaUtil.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif + using namespace std; using namespace Slice; using namespace IceUtil; @@ -421,7 +425,7 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict) out << eb; string countMethod = dict.indices[i].member.empty() ? - "valueCount" : dict.indices[i].member + "Count"; + string("valueCount") : dict.indices[i].member + "Count"; out << sp << nl << "public int"; out << nl << countMethod << "(" << typeToString(indexTypes[i], TypeModeIn) << " __index)"; @@ -1103,7 +1107,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/slice2freezej/Makefile.mak b/cpp/src/slice2freezej/Makefile.mak new file mode 100644 index 00000000000..e0bcf11123d --- /dev/null +++ b/cpp/src/slice2freezej/Makefile.mak @@ -0,0 +1,31 @@ +# ********************************************************************** +# +# 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\slice2freezej.exe + +TARGETS = $(NAME) + +OBJS = 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 diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 16792718e7f..335e41439ee 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -1365,7 +1365,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) } out << sp; - out << nl << "public " << (hasAMD ? "void" : retS) << nl << opName << spar << params; + out << nl << "public " << (hasAMD ? string("void") : retS) << nl << opName << spar << params; if(!p->isLocal()) { out << "Ice.Current __current"; diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp index efa0aab8be1..4b65540c5f4 100644 --- a/cpp/src/slice2java/Main.cpp +++ b/cpp/src/slice2java/Main.cpp @@ -11,6 +11,10 @@ #include <Slice/Preprocessor.h> #include <Gen.h> +#ifdef __BCPLUSPLUS__ +# include <iterator> +#endif + using namespace std; using namespace Slice; @@ -81,7 +85,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/slice2java/Makefile.mak b/cpp/src/slice2java/Makefile.mak new file mode 100644 index 00000000000..ef6811248df --- /dev/null +++ b/cpp/src/slice2java/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\slice2java.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 diff --git a/cpp/src/slice2javae/Main.cpp b/cpp/src/slice2javae/Main.cpp index 3cace01643f..b9c05a9f0d7 100644 --- a/cpp/src/slice2javae/Main.cpp +++ b/cpp/src/slice2javae/Main.cpp @@ -72,7 +72,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/slice2javae/Makefile.mak b/cpp/src/slice2javae/Makefile.mak new file mode 100644 index 00000000000..fdf5cdf8ecc --- /dev/null +++ b/cpp/src/slice2javae/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\slice2javae.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 diff --git a/cpp/src/slice2py/Main.cpp b/cpp/src/slice2py/Main.cpp index 5b625547355..921448ba32b 100644 --- a/cpp/src/slice2py/Main.cpp +++ b/cpp/src/slice2py/Main.cpp @@ -415,7 +415,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/slice2py/Makefile.mak b/cpp/src/slice2py/Makefile.mak new file mode 100644 index 00000000000..ace0362ff91 --- /dev/null +++ b/cpp/src/slice2py/Makefile.mak @@ -0,0 +1,31 @@ +# ********************************************************************** +# +# 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\slice2py.exe + +TARGETS = $(NAME) + +OBJS = 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 diff --git a/cpp/src/slice2vb/Gen.cpp b/cpp/src/slice2vb/Gen.cpp index ed0a1a92632..59b868efe27 100755 --- a/cpp/src/slice2vb/Gen.cpp +++ b/cpp/src/slice2vb/Gen.cpp @@ -4595,7 +4595,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) ContainedPtr contained = ContainedPtr::dynamicCast(ret); _out << nl << "Dim ret__ As " << retS << " = Nothing"; _out << nl << "Dim ret___PP As IceInternal.ParamPatcher = New IceInternal.ParamPatcher(GetType(" - << retS << "), \"" << (contained ? contained->scoped() : "::Ice::Object") << "\")"; + << retS << "), \"" << (contained ? contained->scoped() : string("::Ice::Object")) << "\")"; _out << nl << "is__.readObject(ret___PP)"; } else diff --git a/cpp/src/slice2vb/Main.cpp b/cpp/src/slice2vb/Main.cpp index 60d7591057b..42f42d57f46 100644 --- a/cpp/src/slice2vb/Main.cpp +++ b/cpp/src/slice2vb/Main.cpp @@ -78,7 +78,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/slice2vb/Makefile.mak b/cpp/src/slice2vb/Makefile.mak new file mode 100644 index 00000000000..8fd3bc341d6 --- /dev/null +++ b/cpp/src/slice2vb/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\slice2vb.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 |