]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Updated SALOME Kernel sources for building under Ms Visual .NET on Windows platform.
authorstv <stv@opencascade.com>
Mon, 20 Feb 2006 09:08:28 +0000 (09:08 +0000)
committerstv <stv@opencascade.com>
Mon, 20 Feb 2006 09:08:28 +0000 (09:08 +0000)
src/SALOMELocalTrace/FileTraceCollector.cxx
src/SALOMELocalTrace/LocalTraceBufferPool.cxx
src/TOOLSDS/SALOMEDS_Tool.cxx
src/TestContainer/SALOME_TestComponent_i.cxx
src/TestContainer/SALOME_TestComponent_i.hxx

index 61ac812273eb35766164fbaea9b9641d8d5cdb2b..61ccf96b97ad319c7e5f112135ea651ddce5b4f2 100644 (file)
@@ -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);
index c7d321ec6597dbb7093f1f8e1547a5fcf7efdcfc..488802b88200ee1913def91a6b44cbe8c85385c7 100644 (file)
@@ -31,6 +31,7 @@
 #ifndef WNT
 #include <dlfcn.h>
 #else
+#include <windows.h>
 #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" <<endl;
-                     cerr << "dlerror: " << error << endl;
-                     assert(error == NULL); // to give file and line
-                     exit(1);               // in case assert is deactivated
+#ifndef WNT
+                     cerr << "dlerror: " << dlerror() << endl;
+#endif
+                     exit( 1 );
                    }
                  _myThreadTrace = (TraceCollectorFactory) ();
                }
index fa13a1eb42756a3ed27dbcdae66f5ab00c00a053..89065afab6be92ed21452cc07ff3382a6ec1102f 100644 (file)
@@ -49,6 +49,7 @@
 #endif
 #include <stdlib.h>
 
+#include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
 
 using namespace std;
index 64772b14e21b8c234f8321dda49f46044d83c842..54ec1799f18a523121cd364bcceb3597cbb7e872 100644 (file)
@@ -26,7 +26,7 @@
 //  Module : SALOME
 //  $Header$
 
-#define private protected
+//#define private protected
 #include "utilities.h"
 #include "SALOME_TestComponent_i.hxx"
 #include <stdio.h>
index 1f135d3d4ca4f95a40a089d2ea5d58d0e2e234d8..92b6adc7f7241dd27fec187a5def930aef5ff08b 100644 (file)
 #define _SALOME_TESTCOMPONENT_I_HXX_
 
 #include <iostream>
+
+#include "SALOME_Component_i.hxx"
+
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_TestComponent)
-#include "SALOME_Component_i.hxx"
 
 class Engines_TestComponent_i: 
   public POA_Engines::TestComponent,