From 6f566db097702ffb645f3f708549a0cc525447c1 Mon Sep 17 00:00:00 2001 From: stv Date: Mon, 20 Feb 2006 09:08:28 +0000 Subject: [PATCH] Updated SALOME Kernel sources for building under Ms Visual .NET on Windows platform. --- src/SALOMELocalTrace/FileTraceCollector.cxx | 2 +- src/SALOMELocalTrace/LocalTraceBufferPool.cxx | 23 ++++++++++++------- src/TOOLSDS/SALOMEDS_Tool.cxx | 1 + src/TestContainer/SALOME_TestComponent_i.cxx | 2 +- src/TestContainer/SALOME_TestComponent_i.hxx | 4 +++- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/SALOMELocalTrace/FileTraceCollector.cxx b/src/SALOMELocalTrace/FileTraceCollector.cxx index 61ac81227..61ccf96b9 100644 --- a/src/SALOMELocalTrace/FileTraceCollector.cxx +++ b/src/SALOMELocalTrace/FileTraceCollector.cxx @@ -64,7 +64,7 @@ BaseTraceCollector* FileTraceCollector::instance(const char *fileName) sem_init(&_sem,0,0); // to wait until run thread is initialized pthread_t traceThread; - int bid; + int bid = 0; int re2 = pthread_create(&traceThread, NULL, FileTraceCollector::run, (void *)bid); sem_wait(&_sem); diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index c7d321ec6..488802b88 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -31,6 +31,7 @@ #ifndef WNT #include #else +#include #endif //#define _DEVDEBUG_ @@ -112,27 +113,33 @@ LocalTraceBufferPool* LocalTraceBufferPool::instance() } else // --- try a dynamic library { - void* handle; #ifndef WNT + void* handle; string impl_name = string ("lib") + traceKind + string("TraceCollector.so"); handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; #else + HINSTANCE handle; string impl_name = string ("lib") + traceKind + string(".dll"); - handle = dlopen( impl_name.c_str() , 0 ) ; + handle = LoadLibrary( impl_name.c_str() ); #endif if ( handle ) { typedef BaseTraceCollector * (*FACTORY_FUNCTION) (void); +#ifndef WNT FACTORY_FUNCTION TraceCollectorFactory = (FACTORY_FUNCTION) dlsym(handle, "SingletonInstance"); - char *error ; - if ( (error = dlerror() ) != NULL) - { +#else + FACTORY_FUNCTION TraceCollectorFactory = + (FACTORY_FUNCTION)GetProcAddress(handle, "SingletonInstance"); +#endif + if ( !TraceCollectorFactory ) + { cerr << "Can't resolve symbol: SingletonInstance" < +#include #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) using namespace std; diff --git a/src/TestContainer/SALOME_TestComponent_i.cxx b/src/TestContainer/SALOME_TestComponent_i.cxx index 64772b14e..54ec1799f 100644 --- a/src/TestContainer/SALOME_TestComponent_i.cxx +++ b/src/TestContainer/SALOME_TestComponent_i.cxx @@ -26,7 +26,7 @@ // Module : SALOME // $Header$ -#define private protected +//#define private protected #include "utilities.h" #include "SALOME_TestComponent_i.hxx" #include diff --git a/src/TestContainer/SALOME_TestComponent_i.hxx b/src/TestContainer/SALOME_TestComponent_i.hxx index 1f135d3d4..92b6adc7f 100644 --- a/src/TestContainer/SALOME_TestComponent_i.hxx +++ b/src/TestContainer/SALOME_TestComponent_i.hxx @@ -30,9 +30,11 @@ #define _SALOME_TESTCOMPONENT_I_HXX_ #include + +#include "SALOME_Component_i.hxx" + #include #include CORBA_SERVER_HEADER(SALOME_TestComponent) -#include "SALOME_Component_i.hxx" class Engines_TestComponent_i: public POA_Engines::TestComponent, -- 2.39.2