From cbb844f4e6a559bef2195bfe84b5f83b6e533d57 Mon Sep 17 00:00:00 2001 From: env Date: Fri, 29 Jul 2005 04:35:49 +0000 Subject: [PATCH] ENV: Windows porting --- src/Registry/RegistryService.cxx | 10 +++++++-- src/Registry/RegistryService.hxx | 22 +++++++++++++++++-- src/Registry/SALOME_Registry_Server.cxx | 8 +++++++ src/SALOMELocalTrace/LocalTraceBufferPool.cxx | 4 ++++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/Registry/RegistryService.cxx b/src/Registry/RegistryService.cxx index 0992377c3..77c55a7a1 100644 --- a/src/Registry/RegistryService.cxx +++ b/src/Registry/RegistryService.cxx @@ -110,8 +110,11 @@ CORBA::ULong RegistryService::add( const Registry::Infos & infos ) return (CORBA::ULong)_Compteur ; } - +#ifndef WNT void RegistryService::remove( const CORBA::ULong id) +#else +void RegistryService::remove( CORBA::ULong id) +#endif { BEGIN_OF("RegistryService::remove") ; SCRUTE(id) ; @@ -135,8 +138,11 @@ void RegistryService::remove( const CORBA::ULong id) } - +#ifndef WNT void RegistryService::hello( const CORBA::ULong id ) +#else +void RegistryService::hello( CORBA::ULong id ) +#endif { BEGIN_OF("RegistryService::hello") ; SCRUTE(id) ; diff --git a/src/Registry/RegistryService.hxx b/src/Registry/RegistryService.hxx index 63f7d57e4..c07043e50 100644 --- a/src/Registry/RegistryService.hxx +++ b/src/Registry/RegistryService.hxx @@ -34,8 +34,21 @@ # include - -class RegistryService : public POA_Registry::Components //, public PortableServer::RefCountServantBase +#if defined REGISTRY_EXPORTS +#if defined WIN32 +#define REGISTRY_EXPORT __declspec( dllexport ) +#else +#define REGISTRY_EXPORT +#endif +#else +#if defined WNT +#define REGISTRY_EXPORT __declspec( dllimport ) +#else +#define REGISTRY_EXPORT +#endif +#endif + +class REGISTRY_EXPORT RegistryService : public POA_Registry::Components //, public PortableServer::RefCountServantBase { public : @@ -73,8 +86,13 @@ public : void ping(); virtual CORBA::ULong add (const Registry::Infos & infos); virtual CORBA::ULong size ( void ); +#ifndef WNT virtual void remove( const CORBA::ULong id ); virtual void hello( const CORBA::ULong id ); +#else + virtual void remove( CORBA::ULong id ); + virtual void hello( CORBA::ULong id ); +#endif virtual void end(void); virtual Registry::AllInfos *getall(void); diff --git a/src/Registry/SALOME_Registry_Server.cxx b/src/Registry/SALOME_Registry_Server.cxx index 0756e2b70..c5191de51 100644 --- a/src/Registry/SALOME_Registry_Server.cxx +++ b/src/Registry/SALOME_Registry_Server.cxx @@ -105,7 +105,11 @@ int main( int argc , char **argv ) for (int i = 1; i<=NumberOfTries; i++) { if (i!=1) +#ifndef WNT a=nanosleep(&ts_req,&ts_rem); +#else + Sleep(TIMESleep/1000000); +#endif try { obj = orb->resolve_initial_references("RootPOA"); @@ -130,7 +134,11 @@ int main( int argc , char **argv ) for(int j=1; j<=NumberOfTries; j++) { if (j!=1) +#ifndef WNT a=nanosleep(&ts_req, &ts_rem); +#else + Sleep(TIMESleep/1000000); +#endif try { object = inc->resolve(name); diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index 8a997221a..0f4962c34 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -37,7 +37,11 @@ using namespace std; #define MAXMESS_LENGTH MAX_TRACE_LENGTH-5 LocalTraceBufferPool* LocalTraceBufferPool::_singleton = 0; +#ifndef WNT pthread_mutex_t LocalTraceBufferPool::_singletonMutex; +#else +pthread_mutex_t LocalTraceBufferPool::_singletonMutex = PTHREAD_MUTEX_INITIALIZER; +#endif // ============================================================================ /*! -- 2.39.2