From e6587e97555fd5680cddffdab5cba882b0a97286 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Sun, 1 Feb 2004 15:44:24 +0000 Subject: [PATCH] Fix to get around weird HP aCC behaviour ("C" linkage for friends): caInstallDefaultService() calls a static member function instead of being a friend. --- src/ca/ca_client_context.cpp | 10 +++++++--- src/ca/oldAccess.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ca/ca_client_context.cpp b/src/ca/ca_client_context.cpp index 17d7e9475..efcac8f95 100644 --- a/src/ca/ca_client_context.cpp +++ b/src/ca/ca_client_context.cpp @@ -727,14 +727,18 @@ cacContext & ca_client_context::createNetworkContext ( return * new cac ( mutexIn, cbMutexIn, *this ); } -void epicsShareAPI caInstallDefaultService ( cacService & service ) +void ca_client_context::installDefaultService ( cacService & service ) { // this wont consistently work if called from file scope constructor epicsGuard < epicsMutex > guard ( ca_client_context::defaultServiceInstallMutex ); if ( ca_client_context::pDefaultService ) { - throw std::logic_error ( "CA in-memory service already installed and can't be replaced"); + throw std::logic_error + ( "CA in-memory service already installed and can't be replaced"); } ca_client_context::pDefaultService = & service; } - +void epicsShareAPI caInstallDefaultService ( cacService & service ) +{ + ca_client_context::installDefaultService ( service ); +} diff --git a/src/ca/oldAccess.h b/src/ca/oldAccess.h index e1207e7ef..12d249a3e 100644 --- a/src/ca/oldAccess.h +++ b/src/ca/oldAccess.h @@ -307,6 +307,7 @@ public: void blockForEventAndEnableCallbacks ( epicsEvent & event, const double & timeout ); CASG * lookupCASG ( epicsGuard < epicsMutex > &, unsigned id ); + static void installDefaultService ( cacService & ); void installCASG ( epicsGuard < epicsMutex > &, CASG & ); void uninstallCASG ( epicsGuard < epicsMutex > &, CASG & ); void selfTest () const; @@ -389,7 +390,6 @@ private: friend int epicsShareAPI ca_sg_block ( const CA_SYNC_GID gid, ca_real timeout ); friend int epicsShareAPI ca_sg_reset ( const CA_SYNC_GID gid ); friend int epicsShareAPI ca_sg_test ( const CA_SYNC_GID gid ); - friend void epicsShareAPI caInstallDefaultService ( cacService & ); friend int epicsShareAPI ca_change_connection_event ( chid pChan, caCh *pfunc ); friend int epicsShareAPI ca_replace_access_rights_event ( chid pChan, caArh *pfunc ); friend void epicsShareAPI ca_get_host_name ( chid pChan, char *pBuf, unsigned bufLength );