diff options
Diffstat (limited to 'cpp/src')
32 files changed, 268 insertions, 179 deletions
diff --git a/cpp/src/Freeze/Makefile b/cpp/src/Freeze/Makefile index 91281d1cf52..5fb7b6344d2 100644 --- a/cpp/src/Freeze/Makefile +++ b/cpp/src/Freeze/Makefile @@ -30,8 +30,8 @@ SRCS = $(OBJS:.o=.cpp) HDIR = $(includedir)/Freeze SDIR = $(slicedir)/Freeze -SLICECMD = $(SLICE2CPP) --include-dir Freeze --dll-export FREEZE_API -I$(slicedir) -SLICE2FREEZECMD = $(SLICE2FREEZE) --include-dir Freeze -I$(slicedir) +SLICECMD = $(SLICE2CPP) --ice --include-dir Freeze --dll-export FREEZE_API -I$(slicedir) +SLICE2FREEZECMD = $(SLICE2FREEZE) --ice --include-dir Freeze -I$(slicedir) include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/Ice/Makefile b/cpp/src/Ice/Makefile index df5b7019a25..2262ab8675e 100644 --- a/cpp/src/Ice/Makefile +++ b/cpp/src/Ice/Makefile @@ -90,7 +90,7 @@ SRCS = $(OBJS:.o=.cpp) HDIR = $(includedir)/Ice SDIR = $(slicedir)/Ice -SLICECMD = $(SLICE2CPP) --include-dir Ice --dll-export ICE_API -I$(slicedir) +SLICECMD = $(SLICE2CPP) --ice --include-dir Ice --dll-export ICE_API -I$(slicedir) include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/IceBox/Makefile b/cpp/src/IceBox/Makefile index 94580eb53fc..1f53ecd6151 100644 --- a/cpp/src/IceBox/Makefile +++ b/cpp/src/IceBox/Makefile @@ -34,8 +34,8 @@ SRCS = $(OBJS:.o=.cpp) \ HDIR = $(includedir)/IceBox SDIR = $(slicedir)/IceBox -SLICECMD = $(SLICE2CPP) --include-dir IceBox -I$(slicedir) -SLICE2FREEZECMD = $(SLICE2FREEZE) --include-dir IceBox -I$(slicedir) +SLICECMD = $(SLICE2CPP) --ice --include-dir IceBox -I$(slicedir) +SLICE2FREEZECMD = $(SLICE2FREEZE) --ice --include-dir IceBox -I$(slicedir) include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/IcePack/AdapterManager.ice b/cpp/src/IcePack/AdapterManager.ice index 69ae45c89e1..f9a6e59697b 100644 --- a/cpp/src/IcePack/AdapterManager.ice +++ b/cpp/src/IcePack/AdapterManager.ice @@ -110,14 +110,14 @@ class Adapter * The description of this objet adapter. * */ - AdapterDescription _description; + AdapterDescription description; /** * * A direct proxy created from the adapter. * */ - Object* _proxy; + Object* proxy; }; /** diff --git a/cpp/src/IcePack/AdapterManagerI.cpp b/cpp/src/IcePack/AdapterManagerI.cpp index f5bfc92a7f4..13c0bf73e26 100644 --- a/cpp/src/IcePack/AdapterManagerI.cpp +++ b/cpp/src/IcePack/AdapterManagerI.cpp @@ -87,7 +87,7 @@ IcePack::AdapterI::~AdapterI() AdapterDescription IcePack::AdapterI::getAdapterDescription(const Current&) { - return _description; + return description; } ObjectPrx @@ -95,16 +95,16 @@ IcePack::AdapterI::getDirectProxy(bool activate, const Current&) { ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); - if(!activate || !_description.server || _active) + if(!activate || !description.server || _active) { - return _proxy; + return proxy; } // // If there's a server associated to this adapter, try to start // the server and wait for the adapter state to change. // - if(_description.server && _description.server->start()) + if(description.server && description.server->start()) { // // Wait for this adapter to be marked as active or the @@ -120,14 +120,14 @@ IcePack::AdapterI::getDirectProxy(bool activate, const Current&) } } - return _proxy; + return proxy; } void IcePack::AdapterI::setDirectProxy(const ObjectPrx& proxy, const Current&) { ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); - _proxy = proxy; + this->proxy = proxy; } void @@ -194,8 +194,8 @@ IcePack::AdapterManagerI::create(const AdapterDescription& description, const Cu } AdapterPtr adapterI = new AdapterI(_waitTime); - adapterI->_description = description; - adapterI->_proxy = 0; + adapterI->description = description; + adapterI->proxy = 0; // // Add this adapter name to our adapter names internal set. diff --git a/cpp/src/IcePack/Makefile b/cpp/src/IcePack/Makefile index 8dc42d2c99a..4833dcd761c 100644 --- a/cpp/src/IcePack/Makefile +++ b/cpp/src/IcePack/Makefile @@ -50,7 +50,7 @@ SRCS = $(OBJS:.o=.cpp) \ HDIR = $(includedir)/IcePack LOCAL_HDIR = ../IcePack SDIR = $(slicedir)/IcePack -SLICECMD = $(SLICE2CPP) --include-dir IcePack --dll-export ICE_PACK_API -I$(slicedir) +SLICECMD = $(SLICE2CPP) --ice --include-dir IcePack --dll-export ICE_PACK_API -I$(slicedir) include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/IcePack/ServerManager.ice b/cpp/src/IcePack/ServerManager.ice index 577b376beb8..d9dfed8f3ef 100644 --- a/cpp/src/IcePack/ServerManager.ice +++ b/cpp/src/IcePack/ServerManager.ice @@ -66,14 +66,14 @@ class Server * The description of this server. * */ - ServerDescription _description; + ServerDescription description; /** * * The adapter proxies. * **/ - Adapters _adapters; + Adapters adapters; }; class ServerManager diff --git a/cpp/src/IcePack/ServerManagerI.cpp b/cpp/src/IcePack/ServerManagerI.cpp index 6dd9a240582..0ac1d4bbbec 100644 --- a/cpp/src/IcePack/ServerManagerI.cpp +++ b/cpp/src/IcePack/ServerManagerI.cpp @@ -94,7 +94,7 @@ IcePack::ServerI::~ServerI() ServerDescription IcePack::ServerI::getServerDescription(const Current&) { - return _description; + return description; } bool @@ -131,14 +131,14 @@ IcePack::ServerI::start(const Current&) try { - bool activated = _activator->activate(ServerNameToServer(_adapter)(_description.name)); + bool activated = _activator->activate(ServerNameToServer(_adapter)(description.name)); setState(activated ? Active : Inactive); return activated; } catch (const SystemException& ex) { Warning out(_adapter->getCommunicator()->getLogger()); - out << "activation failed for server `" << _description.name << "':\n"; + out << "activation failed for server `" << description.name << "':\n"; out << ex; setState(Inactive); @@ -157,10 +157,10 @@ IcePack::ServerI::terminationCallback(const Current&) setState(Deactivating); // - // Mark each adapter as inactive. _adapters is immutable when + // Mark each adapter as inactive. adapters is immutable when // state == Deactivating. // - for(Adapters::iterator p = _adapters.begin(); p != _adapters.end(); ++p) + for(Adapters::iterator p = adapters.begin(); p != adapters.end(); ++p) { (*p)->markAsInactive(); } @@ -238,11 +238,11 @@ IcePack::ServerManagerI::create(const ServerDescription& desc, const Current&) } ServerPtr serverI = new ServerI(_adapter, _activator); - serverI->_description = desc; + serverI->description = desc; for(AdapterNames::const_iterator p = desc.adapters.begin(); p != desc.adapters.end(); ++p) { AdapterPrx adapter = _adapterManager->findByName(*p); - serverI->_adapters.push_back(adapter); + serverI->adapters.push_back(adapter); } _evictor->createObject(server->ice_getIdentity(), serverI); diff --git a/cpp/src/IcePatch/Makefile b/cpp/src/IcePatch/Makefile index 1b5b96640c6..3bb1adc60c3 100644 --- a/cpp/src/IcePatch/Makefile +++ b/cpp/src/IcePatch/Makefile @@ -37,7 +37,7 @@ SRCS = $(OBJS:.o=.cpp) \ HDIR = $(includedir)/IcePatch SDIR = $(slicedir)/IcePatch -SLICECMD = $(SLICE2CPP) --include-dir IcePatch --dll-export ICE_PATCH_API -I$(slicedir) +SLICECMD = $(SLICE2CPP) --ice --include-dir IcePatch --dll-export ICE_PATCH_API -I$(slicedir) include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/IceSSL/ConfigParser.cpp b/cpp/src/IceSSL/ConfigParser.cpp index e7f689c8b65..124d51b4069 100644 --- a/cpp/src/IceSSL/ConfigParser.cpp +++ b/cpp/src/IceSSL/ConfigParser.cpp @@ -66,7 +66,7 @@ IceSSL::ConfigParser::process() s << "while parsing " << _configFile << ": " << endl; s << "xerces-c init exception: " << DOMString(toCatch.getMessage()); - configEx._message = s.str(); + configEx.message = s.str(); throw configEx; } @@ -129,7 +129,7 @@ IceSSL::ConfigParser::process() s << "while parsing " << _configFile << ": " << endl; s << "xerces-c parsing error: " << DOMString(e.getMessage()); - configEx._message = s.str(); + configEx.message = s.str(); throw configEx; } @@ -142,7 +142,7 @@ IceSSL::ConfigParser::process() s << "xerces-c DOM parsing error, DOMException code: " << e.code; s << ", message: " << e.msg; - configEx._message = s.str(); + configEx.message = s.str(); throw configEx; } @@ -150,7 +150,7 @@ IceSSL::ConfigParser::process() { ConfigParseException configEx(__FILE__, __LINE__); - configEx._message = "while parsing " + _configFile + "\n" + "unknown error occured during parsing"; + configEx.message = "while parsing " + _configFile + "\n" + "unknown error occured during parsing"; throw configEx; } @@ -163,14 +163,14 @@ IceSSL::ConfigParser::process() errStr << dec << errorCount << " errors occured during parsing"; - configEx._message = errStr.str(); + configEx.message = errStr.str(); string reporterErrors = errReporter->getErrors(); if(!reporterErrors.empty()) { - configEx._message += "\n"; - configEx._message += reporterErrors; + configEx.message += "\n"; + configEx.message += reporterErrors; } throw configEx; @@ -205,7 +205,7 @@ IceSSL::ConfigParser::loadClientConfig(GeneralConfig& general, s << "xerces-c DOM parsing error, DOMException code: " << e.code; s << ", message: " << e.msg; - configEx._message = s.str(); + configEx.message = s.str(); throw configEx; } @@ -243,7 +243,7 @@ IceSSL::ConfigParser::loadServerConfig(GeneralConfig& general, s << "xerces-c DOM parsing error, DOMException code: " << e.code; s << ", message: " << e.msg; - configEx._message = s.str(); + configEx.message = s.str(); throw configEx; } diff --git a/cpp/src/IceSSL/ContextOpenSSL.cpp b/cpp/src/IceSSL/ContextOpenSSL.cpp index 649fe46de9a..3362a876efe 100644 --- a/cpp/src/IceSSL/ContextOpenSSL.cpp +++ b/cpp/src/IceSSL/ContextOpenSSL.cpp @@ -78,7 +78,7 @@ IceSSL::OpenSSL::Context::setRSAKeysBase64(const string& privateKey, { IceSSL::PrivateKeyException privateKeyEx(__FILE__, __LINE__); - privateKeyEx._message = "Empty private key supplied."; + privateKeyEx.message = "Empty private key supplied."; throw privateKeyEx; } @@ -93,7 +93,7 @@ IceSSL::OpenSSL::Context::setRSAKeys(const Ice::ByteSeq& privateKey, const Ice:: { IceSSL::PrivateKeyException privateKeyEx(__FILE__, __LINE__); - privateKeyEx._message = "Empty private key supplied."; + privateKeyEx.message = "Empty private key supplied."; throw privateKeyEx; } @@ -219,7 +219,7 @@ IceSSL::OpenSSL::Context::createContext(SslProtocol sslProtocol) { ContextInitializationException contextInitEx(__FILE__, __LINE__); - contextInitEx._message = "unable to create ssl context\n" + sslGetErrors(); + contextInitEx.message = "unable to create ssl context\n" + sslGetErrors(); throw contextInitEx; } @@ -325,13 +325,13 @@ IceSSL::OpenSSL::Context::checkKeyCert() { CertificateKeyMatchException certKeyMatchEx(__FILE__, __LINE__); - certKeyMatchEx._message = "private key does not match the certificate public key"; + certKeyMatchEx.message = "private key does not match the certificate public key"; string sslError = sslGetErrors(); if(!sslError.empty()) { - certKeyMatchEx._message += "\n"; - certKeyMatchEx._message += sslError; + certKeyMatchEx.message += "\n"; + certKeyMatchEx.message += sslError; } throw certKeyMatchEx; @@ -345,7 +345,7 @@ IceSSL::OpenSSL::Context::addTrustedCertificate(const RSAPublicKey& trustedCerti { ContextNotConfiguredException contextConfigEx(__FILE__, __LINE__); - contextConfigEx._message = "ssl context not configured"; + contextConfigEx.message = "ssl context not configured"; throw contextConfigEx; } @@ -358,7 +358,7 @@ IceSSL::OpenSSL::Context::addTrustedCertificate(const RSAPublicKey& trustedCerti { TrustedCertificateAddException trustEx(__FILE__, __LINE__); - trustEx._message = sslGetErrors(); + trustEx.message = sslGetErrors(); throw trustEx; } @@ -384,10 +384,10 @@ IceSSL::OpenSSL::Context::addKeyCert(const CertificateFile& privateKey, const Ce { CertificateLoadException certLoadEx(__FILE__, __LINE__); - certLoadEx._message = "unable to load certificate from '"; - certLoadEx._message += publicFile; - certLoadEx._message += "'\n"; - certLoadEx._message += sslGetErrors(); + certLoadEx.message = "unable to load certificate from '"; + certLoadEx.message += publicFile; + certLoadEx.message += "'\n"; + certLoadEx.message += sslGetErrors(); throw certLoadEx; } @@ -449,13 +449,13 @@ IceSSL::OpenSSL::Context::addKeyCert(const CertificateFile& privateKey, const Ce { CertificateKeyMatchException certKeyMatchEx(__FILE__, __LINE__); - certKeyMatchEx._message = "private key does not match the certificate public key"; + certKeyMatchEx.message = "private key does not match the certificate public key"; string sslError = sslGetErrors(); if(!sslError.empty()) { - certKeyMatchEx._message += "\n"; - certKeyMatchEx._message += sslError; + certKeyMatchEx.message += "\n"; + certKeyMatchEx.message += sslError; } throw certKeyMatchEx; @@ -464,10 +464,10 @@ IceSSL::OpenSSL::Context::addKeyCert(const CertificateFile& privateKey, const Ce { PrivateKeyLoadException pklEx(__FILE__, __LINE__); - pklEx._message = "unable to load private key from '"; - pklEx._message += privKeyFile; - pklEx._message += "'\n"; - pklEx._message += sslGetErrors(); + pklEx.message = "unable to load private key from '"; + pklEx.message += privKeyFile; + pklEx.message += "'\n"; + pklEx.message += sslGetErrors(); throw pklEx; } @@ -484,7 +484,7 @@ IceSSL::OpenSSL::Context::addKeyCert(const RSAKeyPair& keyPair) { ContextNotConfiguredException contextConfigEx(__FILE__, __LINE__); - contextConfigEx._message = "ssl context not configured"; + contextConfigEx.message = "ssl context not configured"; throw contextConfigEx; } @@ -499,13 +499,13 @@ IceSSL::OpenSSL::Context::addKeyCert(const RSAKeyPair& keyPair) { CertificateLoadException certLoadEx(__FILE__, __LINE__); - certLoadEx._message = "unable to set certificate from memory"; + certLoadEx.message = "unable to set certificate from memory"; string sslError = sslGetErrors(); if(!sslError.empty()) { - certLoadEx._message += "\n"; - certLoadEx._message += sslError; + certLoadEx.message += "\n"; + certLoadEx.message += sslError; } throw certLoadEx; @@ -522,13 +522,13 @@ IceSSL::OpenSSL::Context::addKeyCert(const RSAKeyPair& keyPair) { CertificateKeyMatchException certKeyMatchEx(__FILE__, __LINE__); - certKeyMatchEx._message = "private key does not match the certificate public key"; + certKeyMatchEx.message = "private key does not match the certificate public key"; string sslError = sslGetErrors(); if(!sslError.empty()) { - certKeyMatchEx._message += "\n"; - certKeyMatchEx._message += sslError; + certKeyMatchEx.message += "\n"; + certKeyMatchEx.message += sslError; } throw certKeyMatchEx; @@ -537,13 +537,13 @@ IceSSL::OpenSSL::Context::addKeyCert(const RSAKeyPair& keyPair) { PrivateKeyLoadException pklEx(__FILE__, __LINE__); - pklEx._message = "unable to set private key from memory"; + pklEx.message = "unable to set private key from memory"; string sslError = sslGetErrors(); if(!sslError.empty()) { - pklEx._message += "\n"; - pklEx._message += sslError; + pklEx.message += "\n"; + pklEx.message += sslError; } throw pklEx; diff --git a/cpp/src/IceSSL/Makefile b/cpp/src/IceSSL/Makefile index 8a5c2a70503..eabd9908d6e 100644 --- a/cpp/src/IceSSL/Makefile +++ b/cpp/src/IceSSL/Makefile @@ -59,7 +59,7 @@ SRCS = $(OBJS:.o=.cpp) HDIR = $(includedir)/IceSSL SDIR = $(slicedir)/IceSSL -SLICECMD = $(SLICE2CPP) --include-dir IceSSL --dll-export ICE_SSL_API -I$(slicedir) +SLICECMD = $(SLICE2CPP) --ice --include-dir IceSSL --dll-export ICE_SSL_API -I$(slicedir) include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/IceSSL/OpenSSLPluginI.cpp b/cpp/src/IceSSL/OpenSSLPluginI.cpp index 03bc1c9f1fb..1116c7405ac 100644 --- a/cpp/src/IceSSL/OpenSSLPluginI.cpp +++ b/cpp/src/IceSSL/OpenSSLPluginI.cpp @@ -142,7 +142,7 @@ IceSSL::OpenSSL::PluginI::createConnection(ContextType connectionType, int socke { UnsupportedContextException unsupportedException(__FILE__, __LINE__); - unsupportedException._message = "unable to create client/server connections"; + unsupportedException.message = "unable to create client/server connections"; throw unsupportedException; } @@ -298,8 +298,8 @@ IceSSL::OpenSSL::PluginI::loadConfig(ContextType contextType, } } - configEx._message = "no ssl configuration file specified for "; - configEx._message += contextString; + configEx.message = "no ssl configuration file specified for "; + configEx.message += contextString; throw configEx; } diff --git a/cpp/src/IceSSL/RSACertificateGen.cpp b/cpp/src/IceSSL/RSACertificateGen.cpp index a0a21d33cad..77aaeb10b8e 100644 --- a/cpp/src/IceSSL/RSACertificateGen.cpp +++ b/cpp/src/IceSSL/RSACertificateGen.cpp @@ -301,10 +301,10 @@ IceSSL::OpenSSL::RSACertificateGen::loadKeyPair(const std::string& keyFile, cons { IceSSL::OpenSSL::CertificateLoadException certLoadEx(__FILE__, __LINE__); - certLoadEx._message = "unable to load certificate from '"; - certLoadEx._message += certFile; - certLoadEx._message += "'\n"; - certLoadEx._message += sslGetErrors(); + certLoadEx.message = "unable to load certificate from '"; + certLoadEx.message += certFile; + certLoadEx.message += "'\n"; + certLoadEx.message += sslGetErrors(); throw certLoadEx; } @@ -315,10 +315,10 @@ IceSSL::OpenSSL::RSACertificateGen::loadKeyPair(const std::string& keyFile, cons { IceSSL::OpenSSL::CertificateLoadException certLoadEx(__FILE__, __LINE__); - certLoadEx._message = "unable to load certificate from '"; - certLoadEx._message += certFile; - certLoadEx._message += "'\n"; - certLoadEx._message += sslGetErrors(); + certLoadEx.message = "unable to load certificate from '"; + certLoadEx.message += certFile; + certLoadEx.message += "'\n"; + certLoadEx.message += sslGetErrors(); throw certLoadEx; } @@ -331,10 +331,10 @@ IceSSL::OpenSSL::RSACertificateGen::loadKeyPair(const std::string& keyFile, cons { IceSSL::OpenSSL::PrivateKeyLoadException pklEx(__FILE__, __LINE__); - pklEx._message = "unable to load private key from '"; - pklEx._message += keyFile; - pklEx._message += "'\n"; - pklEx._message += sslGetErrors(); + pklEx.message = "unable to load private key from '"; + pklEx.message += keyFile; + pklEx.message += "'\n"; + pklEx.message += sslGetErrors(); throw pklEx; } @@ -345,10 +345,10 @@ IceSSL::OpenSSL::RSACertificateGen::loadKeyPair(const std::string& keyFile, cons { IceSSL::OpenSSL::PrivateKeyLoadException pklEx(__FILE__, __LINE__); - pklEx._message = "unable to load private key from '"; - pklEx._message += keyFile; - pklEx._message += "'\n"; - pklEx._message += sslGetErrors(); + pklEx.message = "unable to load private key from '"; + pklEx.message += keyFile; + pklEx.message += "'\n"; + pklEx.message += sslGetErrors(); throw pklEx; } diff --git a/cpp/src/IceSSL/RSAPrivateKey.cpp b/cpp/src/IceSSL/RSAPrivateKey.cpp index 4b8499ec31a..a3a5f0f98f0 100644 --- a/cpp/src/IceSSL/RSAPrivateKey.cpp +++ b/cpp/src/IceSSL/RSAPrivateKey.cpp @@ -112,7 +112,7 @@ IceSSL::OpenSSL::RSAPrivateKey::byteSeqToKey(const ByteSeq& keySeq) { IceSSL::PrivateKeyParseException pkParseException(__FILE__, __LINE__); - pkParseException._message = "unable to parse provided private key\n" + sslGetErrors(); + pkParseException.message = "unable to parse provided private key\n" + sslGetErrors(); throw pkParseException; } diff --git a/cpp/src/IceSSL/RSAPublicKey.cpp b/cpp/src/IceSSL/RSAPublicKey.cpp index 76c61a6b8f1..4e2e02ea97c 100644 --- a/cpp/src/IceSSL/RSAPublicKey.cpp +++ b/cpp/src/IceSSL/RSAPublicKey.cpp @@ -111,7 +111,7 @@ IceSSL::OpenSSL::RSAPublicKey::byteSeqToCert(const ByteSeq& certSeq) { IceSSL::CertificateParseException certParseException(__FILE__, __LINE__); - certParseException._message = "unable to parse provided public key\n" + sslGetErrors(); + certParseException.message = "unable to parse provided public key\n" + sslGetErrors(); throw certParseException; } diff --git a/cpp/src/IceSSL/SslConnectionOpenSSL.cpp b/cpp/src/IceSSL/SslConnectionOpenSSL.cpp index d7edd9b2dde..32de83aa15a 100644 --- a/cpp/src/IceSSL/SslConnectionOpenSSL.cpp +++ b/cpp/src/IceSSL/SslConnectionOpenSSL.cpp @@ -202,8 +202,8 @@ IceSSL::OpenSSL::Connection::shutdown(int timeout) ProtocolException protocolEx(__FILE__, __LINE__); - protocolEx._message = "encountered a violation of the ssl protocol during shutdown\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered a violation of the ssl protocol during shutdown\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } @@ -671,8 +671,8 @@ IceSSL::OpenSSL::Connection::read(Buffer& buf, int timeout) { ProtocolException protocolEx(__FILE__, __LINE__); - protocolEx._message = "encountered a violation of the ssl protocol\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered a violation of the ssl protocol\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } diff --git a/cpp/src/IceSSL/SslConnectionOpenSSLClient.cpp b/cpp/src/IceSSL/SslConnectionOpenSSLClient.cpp index c2d82b52ff3..a84d0a82431 100644 --- a/cpp/src/IceSSL/SslConnectionOpenSSLClient.cpp +++ b/cpp/src/IceSSL/SslConnectionOpenSSLClient.cpp @@ -169,14 +169,14 @@ IceSSL::OpenSSL::ClientConnection::handshake(int timeout) { CertificateVerificationException certVerEx(__FILE__, __LINE__); - certVerEx._message = getVerificationError(verifyError); + certVerEx.message = getVerificationError(verifyError); string errors = sslGetErrors(); if(!errors.empty()) { - certVerEx._message += "\n"; - certVerEx._message += errors; + certVerEx.message += "\n"; + certVerEx.message += errors; } throw certVerEx; @@ -185,8 +185,8 @@ IceSSL::OpenSSL::ClientConnection::handshake(int timeout) { ProtocolException protocolEx(__FILE__, __LINE__); - protocolEx._message = "encountered a violation of the ssl protocol during handshake\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered a violation of the ssl protocol during handshake\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } @@ -329,8 +329,8 @@ IceSSL::OpenSSL::ClientConnection::write(Buffer& buf, int timeout) ProtocolException protocolEx(__FILE__, __LINE__); // Protocol Error: Unexpected EOF - protocolEx._message = "encountered an EOF that violates the ssl protocol\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered an EOF that violates the ssl protocol\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } @@ -345,8 +345,8 @@ IceSSL::OpenSSL::ClientConnection::write(Buffer& buf, int timeout) { ProtocolException protocolEx(__FILE__, __LINE__); - protocolEx._message = "encountered a violation of the ssl protocol\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered a violation of the ssl protocol\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } diff --git a/cpp/src/IceSSL/SslConnectionOpenSSLServer.cpp b/cpp/src/IceSSL/SslConnectionOpenSSLServer.cpp index fbc43e78391..5548ee82bcc 100644 --- a/cpp/src/IceSSL/SslConnectionOpenSSLServer.cpp +++ b/cpp/src/IceSSL/SslConnectionOpenSSLServer.cpp @@ -107,8 +107,8 @@ IceSSL::OpenSSL::ServerConnection::handshake(int timeout) { ProtocolException protocolEx(__FILE__, __LINE__); - protocolEx._message = "encountered an ssl protocol violation during handshake\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered an ssl protocol violation during handshake\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } @@ -170,8 +170,8 @@ IceSSL::OpenSSL::ServerConnection::handshake(int timeout) ProtocolException protocolEx(__FILE__, __LINE__); // Protocol Error: Unexpected EOF - protocolEx._message = "encountered an eof during handshake that violates the ssl protocol\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered an eof during handshake that violates the ssl protocol\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } @@ -181,8 +181,8 @@ IceSSL::OpenSSL::ServerConnection::handshake(int timeout) { ProtocolException protocolEx(__FILE__, __LINE__); - protocolEx._message = "encountered a violation of the ssl protocol during handshake\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered a violation of the ssl protocol during handshake\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } @@ -310,8 +310,8 @@ IceSSL::OpenSSL::ServerConnection::write(Buffer& buf, int timeout) ProtocolException protocolEx(__FILE__, __LINE__); // Protocol Error: Unexpected EOF. - protocolEx._message = "encountered an EOF that violates the ssl protocol\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered an EOF that violates the ssl protocol\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } @@ -321,8 +321,8 @@ IceSSL::OpenSSL::ServerConnection::write(Buffer& buf, int timeout) { ProtocolException protocolEx(__FILE__, __LINE__); - protocolEx._message = "encountered a violation of the ssl protocol\n"; - protocolEx._message += sslGetErrors(); + protocolEx.message = "encountered a violation of the ssl protocol\n"; + protocolEx.message += sslGetErrors(); throw protocolEx; } diff --git a/cpp/src/IceSSL/SslException.cpp b/cpp/src/IceSSL/SslException.cpp index 202436db850..d621b041bbe 100644 --- a/cpp/src/IceSSL/SslException.cpp +++ b/cpp/src/IceSSL/SslException.cpp @@ -18,9 +18,9 @@ void IceSSL::SslException::ice_print(ostream& out) const { Exception::ice_print(out); - if(!_message.empty()) + if(!message.empty()) { - out << ":\n" << _message; + out << ":\n" << message; } } diff --git a/cpp/src/IceStorm/Makefile b/cpp/src/IceStorm/Makefile index 8834e81e94f..ee89e05fad7 100644 --- a/cpp/src/IceStorm/Makefile +++ b/cpp/src/IceStorm/Makefile @@ -57,8 +57,8 @@ SRCS = $(OBJS:.o=.cpp) \ HDIR = $(includedir)/IceStorm SDIR = $(slicedir)/IceStorm -SLICECMD = $(SLICE2CPP) --include-dir IceStorm -I$(slicedir) -I.. -SLICE2FREEZECMD = $(SLICE2FREEZE) --include-dir IceStorm -I$(slicedir) -I.. +SLICECMD = $(SLICE2CPP) --ice --include-dir IceStorm -I$(slicedir) -I.. +SLICE2FREEZECMD = $(SLICE2FREEZE) --ice --include-dir IceStorm -I$(slicedir) -I.. include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index c119d4af163..e0fae075334 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -68,7 +68,7 @@ yyerror(const char* s) // // Other tokens. // -%token ICE_SCOPE_DELIMITOR +%token ICE_SCOPE_DELIMITER %token ICE_IDENTIFIER %token ICE_STRING_LITERAL %token ICE_INTEGER_LITERAL @@ -1141,13 +1141,13 @@ scoped_name : ICE_IDENTIFIER { } -| ICE_SCOPE_DELIMITOR ICE_IDENTIFIER +| ICE_SCOPE_DELIMITER ICE_IDENTIFIER { StringTokPtr ident = StringTokPtr::dynamicCast($2); ident->v = "::" + ident->v; $$ = ident; } -| scoped_name ICE_SCOPE_DELIMITOR ICE_IDENTIFIER +| scoped_name ICE_SCOPE_DELIMITER ICE_IDENTIFIER { StringTokPtr scoped = StringTokPtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($3); diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 8dd38a14f25..fff5079b331 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -231,6 +231,7 @@ Slice::Container::destroy() ModulePtr Slice::Container::createModule(const string& name) { + checkPrefix(name); ContainedList matches = _unit->findContents(thisScope() + name); matches.sort(); // Modules can occur many times... matches.unique(); // ... but we only want one instance of each @@ -276,6 +277,7 @@ Slice::Container::createModule(const string& name) ClassDefPtr Slice::Container::createClassDef(const string& name, bool intf, const ClassList& bases, bool local) { + checkPrefix(name); ContainedList matches = _unit->findContents(thisScope() + name); for(ContainedList::const_iterator p = matches.begin(); p != matches.end(); ++p) { @@ -359,6 +361,8 @@ Slice::Container::createClassDef(const string& name, bool intf, const ClassList& ClassDeclPtr Slice::Container::createClassDecl(const string& name, bool intf, bool local) { + checkPrefix(name); + ClassDefPtr def; ContainedList matches = _unit->findContents(thisScope() + name); @@ -440,6 +444,8 @@ Slice::Container::createClassDecl(const string& name, bool intf, bool local) ExceptionPtr Slice::Container::createException(const string& name, const ExceptionPtr& base, bool local) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -481,6 +487,8 @@ Slice::Container::createException(const string& name, const ExceptionPtr& base, StructPtr Slice::Container::createStruct(const string& name, bool local) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -514,6 +522,8 @@ Slice::Container::createStruct(const string& name, bool local) SequencePtr Slice::Container::createSequence(const string& name, const TypePtr& type, bool local) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -555,6 +565,8 @@ Slice::Container::createSequence(const string& name, const TypePtr& type, bool l DictionaryPtr Slice::Container::createDictionary(const string& name, const TypePtr& keyType, const TypePtr& valueType, bool local) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -607,6 +619,8 @@ Slice::Container::createDictionary(const string& name, const TypePtr& keyType, c EnumPtr Slice::Container::createEnum(const string& name, bool local) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -639,6 +653,8 @@ Slice::Container::createEnum(const string& name, bool local) EnumeratorPtr Slice::Container::createEnumerator(const string& name) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -672,9 +688,8 @@ ConstDefPtr Slice::Container::createConstDef(const string name, const TypePtr& constType, const SyntaxTreeBasePtr& literalType, const string& value) { - // - // Check that the constant name is legal - // + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -1395,6 +1410,18 @@ Slice::Container::checkInterfaceAndLocal(const string& name, bool defined, return true; } +void +Slice::Container::checkPrefix(const string& name) const +{ + if(_unit->currentIncludeLevel() == 0 && !_unit->allowIcePrefix()) + { + if(name.find("Ice", 0) == 0) + { + _unit->error("illegal identifier `" + name + "': `Ice' prefix is reserved"); + } + } +} + // ---------------------------------------------------------------------- // Module // ---------------------------------------------------------------------- @@ -1738,6 +1765,8 @@ OperationPtr Slice::ClassDef::createOperation(const string& name, const TypePtr& returnType) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -1843,6 +1872,8 @@ Slice::ClassDef::createOperation(const string& name, DataMemberPtr Slice::ClassDef::createDataMember(const string& name, const TypePtr& type) { + checkPrefix(name); + assert(!isInterface()); ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) @@ -2176,6 +2207,8 @@ Slice::Exception::destroy() DataMemberPtr Slice::Exception::createDataMember(const string& name, const TypePtr& type) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -2357,6 +2390,8 @@ Slice::Exception::Exception(const ContainerPtr& container, const string& name, c DataMemberPtr Slice::Struct::createDataMember(const string& name, const TypePtr& type) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -3021,6 +3056,8 @@ Slice::Operation::returnType() const ParamDeclPtr Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool isOutParam) { + checkPrefix(name); + ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -3344,9 +3381,9 @@ Slice::DataMember::DataMember(const ContainerPtr& container, const string& name, // ---------------------------------------------------------------------- UnitPtr -Slice::Unit::createUnit(bool ignRedefs, bool all) +Slice::Unit::createUnit(bool ignRedefs, bool all, bool allowIcePrefix) { - return new Unit(ignRedefs, all); + return new Unit(ignRedefs, all, allowIcePrefix); } bool @@ -3355,6 +3392,12 @@ Slice::Unit::ignRedefs() const return _ignRedefs; } +bool +Slice::Unit::allowIcePrefix() const +{ + return _allowIcePrefix; +} + void Slice::Unit::setComment(const string& comment) { @@ -3814,11 +3857,12 @@ Slice::Unit::builtin(Builtin::Kind kind) return builtin; } -Slice::Unit::Unit(bool ignRedefs, bool all) : +Slice::Unit::Unit(bool ignRedefs, bool all, bool allowIcePrefix) : SyntaxTreeBase(0), Container(0), _ignRedefs(ignRedefs), _all(all), + _allowIcePrefix(allowIcePrefix), _errors(0) { _unit = this; diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 264c76ce7ee..410c71ac45e 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -118,21 +118,29 @@ floating_literal (({fractional_constant}{exponent_part}?)|([[:digit:]]+{exponent } "::" { - return ICE_SCOPE_DELIMITOR; + return ICE_SCOPE_DELIMITER; } \\?[[:alpha:]_][[:alnum:]_]* { StringTokPtr ident = new StringTok; - if(*yytext == '\\') // Backslash escapes keyword meaning + ident->v = *yytext == '\\' ? yytext + 1 : yytext; + *yylvalp = ident; + if(ident->v[0] == '_') { - ident->v = yytext + 1; - *yylvalp = ident; - return ICE_IDENTIFIER; + unit->error("illegal leading underscore for identifier `" + ident->v + "'"); } - else + static const string suffixBlacklist[] = { "Helper", "Holder", "Operations", "Prx", "Ptr" }; + for(size_t i = 0; i < sizeof(suffixBlacklist) / sizeof(*suffixBlacklist); ++i) { - ident->v = yytext; - *yylvalp = ident; + if(ident->v.find(suffixBlacklist[i], ident->v.size() - suffixBlacklist[i].size()) != string::npos) + { + unit->error("illegal identifier `" + ident->v + "': `" + suffixBlacklist[i] + "' suffix is reserved"); + } + } + + if(*yytext == '\\') + { + return ICE_IDENTIFIER; } StringTokenMap::const_iterator pos = keywordMap.find(ident->v); diff --git a/cpp/src/Yellow/Makefile b/cpp/src/Yellow/Makefile index 61f12b22121..f14ff8b080f 100644 --- a/cpp/src/Yellow/Makefile +++ b/cpp/src/Yellow/Makefile @@ -45,8 +45,8 @@ SRCS = $(OBJS:.o=.cpp) \ HDIR = $(includedir)/Yellow SDIR = $(slicedir)/Yellow -SLICECMD = $(SLICE2CPP) --include-dir Yellow -I$(slicedir) -I.. -SLICE2FREEZECMD = $(SLICE2FREEZE) --include-dir Yellow -I$(slicedir) -I.. +SLICECMD = $(SLICE2CPP) --ice --include-dir Yellow -I$(slicedir) -I.. +SLICE2FREEZECMD = $(SLICE2FREEZE) --ice --include-dir Yellow -I$(slicedir) -I.. include $(top_srcdir)/config/Make.rules diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index 5eb13c1a3a5..db69a5f8396 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -31,6 +31,7 @@ usage(const char* n) "--dll-export SYMBOL Use SYMBOL for DLL exports.\n" "--impl Generate sample implementations.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -44,6 +45,7 @@ main(int argc, char* argv[]) string dllExport; bool impl = false; bool debug = false; + bool ice = false; int idx = 1; while(idx < argc) @@ -95,6 +97,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(strcmp(argv[idx], "--include-dir") == 0) { if(idx + 1 >= argc) @@ -210,7 +221,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - UnitPtr unit = Unit::createUnit(false, false); + UnitPtr unit = Unit::createUnit(false, false, ice); int parseStatus = unit->parse(cppHandle, debug); #ifdef _WIN32 diff --git a/cpp/src/slice2docbook/Main.cpp b/cpp/src/slice2docbook/Main.cpp index 4eb55e53690..4d8e2cd6112 100644 --- a/cpp/src/slice2docbook/Main.cpp +++ b/cpp/src/slice2docbook/Main.cpp @@ -32,6 +32,7 @@ usage(const char* n) "--chapter Use \"chapter\" instead of \"section\" as\n" " top-level element.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -40,6 +41,7 @@ main(int argc, char* argv[]) { string cpp("cpp -C"); bool debug = false; + bool ice = false; bool standAlone = false; bool noGlobals = false; bool chapter = false; @@ -115,6 +117,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(argv[idx][0] == '-') { cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl; @@ -155,7 +166,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - UnitPtr unit = Unit::createUnit(true, false); + UnitPtr unit = Unit::createUnit(true, false, ice); int status = EXIT_SUCCESS; diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp index 4692dcf2581..047defaa62c 100644 --- a/cpp/src/slice2freeze/Main.cpp +++ b/cpp/src/slice2freeze/Main.cpp @@ -43,6 +43,7 @@ usage(const char* n) " different names. NAME may be a scoped name.\n" "--output-dir DIR Create files in the directory DIR.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -198,6 +199,7 @@ main(int argc, char* argv[]) string dllExport; string output; bool debug = false; + bool ice = false; vector<Dict> dicts; int idx = 1; @@ -308,6 +310,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(strcmp(argv[idx], "--include-dir") == 0) { if(idx + 1 >= argc) @@ -392,7 +403,7 @@ main(int argc, char* argv[]) fileC = output + '/' + fileC; } - UnitPtr unit = Unit::createUnit(true, false); + UnitPtr unit = Unit::createUnit(true, false, ice); StringList includes; diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp index b06ce6efeab..c841716a8cc 100644 --- a/cpp/src/slice2freezej/Main.cpp +++ b/cpp/src/slice2freezej/Main.cpp @@ -308,8 +308,8 @@ usage(const char* n) " option may be specified multiple times for\n" " different names. NAME may be a scoped name.\n" "--output-dir DIR Create files in the directory DIR.\n" - "--ice TBD.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -321,6 +321,7 @@ main(int argc, char* argv[]) string include; string output; bool debug = false; + bool ice = false; vector<Dict> dicts; int idx = 1; @@ -431,6 +432,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(strcmp(argv[idx], "--include-dir") == 0) { if(idx + 1 >= argc) @@ -463,15 +473,6 @@ main(int argc, char* argv[]) } argc -= 2; } - else if(strcmp(argv[idx], "--ice") == 0) - { - // TBD - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } else if(argv[idx][0] == '-') { cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl; @@ -491,7 +492,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - UnitPtr unit = Unit::createUnit(true, false); + UnitPtr unit = Unit::createUnit(true, false, ice); StringList includes; diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp index 0d01dd27769..fd39fe0d277 100644 --- a/cpp/src/slice2java/Main.cpp +++ b/cpp/src/slice2java/Main.cpp @@ -32,8 +32,8 @@ usage(const char* n) "--impl Generate sample implementations.\n" "--impl-tie Generate sample TIE implementations.\n" "--clone Generate clone().\n" - "--ice TBD.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -49,6 +49,7 @@ main(int argc, char* argv[]) bool implTie = false; bool clone = false; bool debug = false; + bool ice = false; int idx = 1; while(idx < argc) @@ -104,6 +105,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(strcmp(argv[idx], "--output-dir") == 0) { if(idx + 1 >= argc) @@ -174,15 +184,6 @@ main(int argc, char* argv[]) } --argc; } - else if(strcmp(argv[idx], "--ice") == 0) - { - // TBD - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } else if(argv[idx][0] == '-') { cerr << argv[0] << ": unknown option `" << argv[idx] << "'" @@ -251,7 +252,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - UnitPtr unit = Unit::createUnit(false, false); + UnitPtr unit = Unit::createUnit(false, false, ice); int parseStatus = unit->parse(cppHandle, debug); #ifdef _WIN32 diff --git a/cpp/src/slice2wsdl/Main.cpp b/cpp/src/slice2wsdl/Main.cpp index a0eb13321ec..132c429cb45 100644 --- a/cpp/src/slice2wsdl/Main.cpp +++ b/cpp/src/slice2wsdl/Main.cpp @@ -26,8 +26,8 @@ usage(const char* n) "-DNAME=DEF Define NAME as DEF.\n" "-UNAME Remove any definition for NAME.\n" "-IDIR Put DIR in the include file search path.\n" - "--ice TBD.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -36,6 +36,7 @@ main(int argc, char* argv[]) { string cpp("cpp -C"); bool debug = false; + bool ice = false; string include; string output; vector<string> includePaths; @@ -90,6 +91,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(strcmp(argv[idx], "--include-dir") == 0) { if(idx + 1 >= argc) @@ -122,15 +132,6 @@ main(int argc, char* argv[]) } argc -= 2; } - else if(strcmp(argv[idx], "--ice") == 0) - { - // TBD - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } else if(argv[idx][0] == '-') { cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl; @@ -190,7 +191,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - UnitPtr unit = Unit::createUnit(false, false); + UnitPtr unit = Unit::createUnit(false, false, ice); int parseStatus = unit->parse(cppHandle, debug); #ifdef _WIN32 diff --git a/cpp/src/slice2xsd/Main.cpp b/cpp/src/slice2xsd/Main.cpp index f3c485ad95c..82395018af4 100644 --- a/cpp/src/slice2xsd/Main.cpp +++ b/cpp/src/slice2xsd/Main.cpp @@ -26,8 +26,8 @@ usage(const char* n) "-DNAME=DEF Define NAME as DEF.\n" "-UNAME Remove any definition for NAME.\n" "-IDIR Put DIR in the include file search path.\n" - "--ice TBD.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -36,6 +36,7 @@ main(int argc, char* argv[]) { string cpp("cpp -C"); bool debug = false; + bool ice = false; string include; string output; vector<string> includePaths; @@ -90,6 +91,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(strcmp(argv[idx], "--include-dir") == 0) { if(idx + 1 >= argc) @@ -122,15 +132,6 @@ main(int argc, char* argv[]) } argc -= 2; } - else if(strcmp(argv[idx], "--ice") == 0) - { - // TBD - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } else if(argv[idx][0] == '-') { cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl; @@ -191,7 +192,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - UnitPtr unit = Unit::createUnit(false, false); + UnitPtr unit = Unit::createUnit(false, false, ice); int parseStatus = unit->parse(cppHandle, debug); #ifdef _WIN32 |