Fix to get around weird HP aCC behaviour ("C" linkage for friends):

caInstallDefaultService() calls a static member function instead of being a friend.
This commit is contained in:
Ralph Lange
2004-02-01 15:44:24 +00:00
parent 3d27e9aeb1
commit e6587e9755
2 changed files with 8 additions and 4 deletions

View File

@@ -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 );
}

View File

@@ -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 );