diff --git a/pvAccessApp/remote/blockingTCPTransport.cpp b/pvAccessApp/remote/blockingTCPTransport.cpp index ec98559..6fe46cd 100644 --- a/pvAccessApp/remote/blockingTCPTransport.cpp +++ b/pvAccessApp/remote/blockingTCPTransport.cpp @@ -30,10 +30,6 @@ typedef SSIZE_T ssize_t; #endif -#ifdef __vxworks -#define INT64_MAX (0x7fffffffffffffffLL) -#endif - using namespace epics::pvData; using std::max; diff --git a/pvAccessApp/remote/blockingUDPTransport.cpp b/pvAccessApp/remote/blockingUDPTransport.cpp index dcc5828..24d2f57 100644 --- a/pvAccessApp/remote/blockingUDPTransport.cpp +++ b/pvAccessApp/remote/blockingUDPTransport.cpp @@ -26,6 +26,13 @@ using namespace std; namespace epics { namespace pvAccess { +#ifdef __vxworks +inline int sendto(int s, const char *buf, size_t len, int flags, const struct sockaddr *to, int tolen) +{ + return ::sendto(s, const_cast(buf), len, flags, const_cast(to), tolen); +} +#endif + PVACCESS_REFCOUNT_MONITOR_DEFINE(blockingUDPTransport); BlockingUDPTransport::BlockingUDPTransport( @@ -295,17 +302,8 @@ namespace epics { bool BlockingUDPTransport::send(ByteBuffer* buffer, const osiSockAddr& address) { buffer->flip(); - int retval = sendto(_channel, -#ifdef __vxworks - (char *) -#endif - buffer->getArray(), - buffer->getLimit(), 0, -#ifdef __vxworks - (sockaddr*) -#endif - &(address.sa), sizeof(sockaddr)); - + int retval = sendto(_channel, buffer->getArray(), + buffer->getLimit(), 0, &(address.sa), sizeof(sockaddr)); if(unlikely(retval<0)) { char errStr[64]; @@ -324,16 +322,8 @@ namespace epics { bool allOK = true; for(size_t i = 0; i<_sendAddresses->size(); i++) { - int retval = sendto(_channel, -#ifdef __vxworks - (char *) -#endif - buffer->getArray(), - buffer->getLimit(), 0, -#ifdef __vxworks - (sockaddr*) -#endif - &((*_sendAddresses)[i].sa), + int retval = sendto(_channel, buffer->getArray(), + buffer->getLimit(), 0, &((*_sendAddresses)[i].sa), sizeof(sockaddr)); if(unlikely(retval<0)) { diff --git a/pvAccessApp/remote/channelSearchManager.h b/pvAccessApp/remote/channelSearchManager.h index 066fa2a..d90c554 100644 --- a/pvAccessApp/remote/channelSearchManager.h +++ b/pvAccessApp/remote/channelSearchManager.h @@ -10,11 +10,6 @@ #include #include -#ifndef __vxworks -/* why not use pvType.h here? */ -#include -#endif - namespace epics { namespace pvAccess { diff --git a/pvAccessApp/rpcService/rpcServer.cpp b/pvAccessApp/rpcService/rpcServer.cpp index c6f6a0c..cafce36 100644 --- a/pvAccessApp/rpcService/rpcServer.cpp +++ b/pvAccessApp/rpcService/rpcServer.cpp @@ -6,8 +6,17 @@ #include #include + #ifdef __vxworks #include +using std::string; +inline int setenv(const char *name, const char *value, int overwrite) +{ + string e(name); + e += "="; + e += value; + return putenv(const_cast(e.c_str())); +} #endif using namespace epics::pvData; @@ -403,11 +412,7 @@ RPCServer::RPCServer() m_channelProviderImpl.reset(new RPCChannelProvider()); registerChannelProvider(m_channelProviderImpl); -#ifdef __vxworks - putenv(const_cast(("EPICS4_CAS_PROVIDER_NAMES=" + m_channelProviderImpl->getProviderName()).c_str())); -#else setenv("EPICS4_CAS_PROVIDER_NAMES", m_channelProviderImpl->getProviderName().c_str(), 1); -#endif m_serverContext = ServerContextImpl::create(); m_serverContext->initialize(getChannelAccess()); diff --git a/pvAccessApp/utils/hexDump.cpp b/pvAccessApp/utils/hexDump.cpp index 0ef140e..ce70873 100644 --- a/pvAccessApp/utils/hexDump.cpp +++ b/pvAccessApp/utils/hexDump.cpp @@ -68,11 +68,7 @@ void hexDump(String const & prologue, String const & name, const int8 *bs, if(((i-start)%16)==0) { out += chars; out += '\n'; -#if defined(__GNUC__) && __GNUC__ < 3 chars.erase(); -#else - chars.clear(); -#endif } chars += toAscii(bs[i]); diff --git a/pvAccessApp/utils/introspectionRegistry.cpp b/pvAccessApp/utils/introspectionRegistry.cpp index af26bb7..7abc636 100644 --- a/pvAccessApp/utils/introspectionRegistry.cpp +++ b/pvAccessApp/utils/introspectionRegistry.cpp @@ -74,20 +74,12 @@ void IntrospectionRegistry::printKeysAndValues(string name) cout << "############## print of all key/values of " << name.c_str() << " registry : ###################" << endl; for(registryMap_t::iterator registryIter = _registry.begin(); registryIter != _registry.end(); registryIter++) { -#if defined(__GNUC__) && __GNUC__ < 3 buffer.erase(); -#else - buffer.clear(); -#endif cout << "\t" << "Key: "<< registryIter->first << endl; cout << "\t" << "Value: " << registryIter->second << endl; cout << "\t" << "References: " << buffer.c_str() << endl; -#if defined(__GNUC__) && __GNUC__ < 3 buffer.erase(); -#else - buffer.clear(); -#endif registryIter->second->toString(&buffer); cout << "\t" << "Value toString: " << buffer.c_str() << endl; }